@sixb/app 0.2.4 → 0.2.6
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/assets/connector-icons/README.md +1 -0
- package/assets/connector-icons/ctm.png +0 -0
- package/dist/agent/activity-label.d.ts.map +1 -1
- package/dist/agent/agent-chat.d.ts +3 -1
- package/dist/agent/agent-chat.d.ts.map +1 -1
- package/dist/agent/agent-panel.d.ts.map +1 -1
- package/dist/agent/artifact-panel.d.ts +3 -1
- package/dist/agent/artifact-panel.d.ts.map +1 -1
- package/dist/agent/components/agent-threads.d.ts.map +1 -1
- package/dist/agent/components/composer-place.d.ts.map +1 -1
- package/dist/agent/components/composer-settings.d.ts +1 -1
- package/dist/agent/components/composer-settings.d.ts.map +1 -1
- package/dist/agent/components/composer.d.ts +22 -5
- package/dist/agent/components/composer.d.ts.map +1 -1
- package/dist/agent/components/computer-place.d.ts +24 -6
- package/dist/agent/components/computer-place.d.ts.map +1 -1
- package/dist/agent/components/context-meter.d.ts +1 -1
- package/dist/agent/components/context-meter.d.ts.map +1 -1
- package/dist/agent/components/conversation-panel.d.ts +5 -2
- package/dist/agent/components/conversation-panel.d.ts.map +1 -1
- package/dist/agent/components/message-parts.d.ts +2 -1
- package/dist/agent/components/message-parts.d.ts.map +1 -1
- package/dist/agent/components/message-view.d.ts +13 -3
- package/dist/agent/components/message-view.d.ts.map +1 -1
- package/dist/agent/components/pending-messages.d.ts +20 -0
- package/dist/agent/components/pending-messages.d.ts.map +1 -0
- package/dist/agent/components/sandbox-recovery.d.ts +11 -2
- package/dist/agent/components/sandbox-recovery.d.ts.map +1 -1
- package/dist/agent/components/threads-button.d.ts +1 -1
- package/dist/agent/components/threads-button.d.ts.map +1 -1
- package/dist/agent/components/transcript.d.ts +13 -0
- package/dist/agent/components/transcript.d.ts.map +1 -1
- package/dist/agent/conversation.d.ts +7 -6
- package/dist/agent/conversation.d.ts.map +1 -1
- package/dist/agent/delegation/interpret.d.ts +5 -0
- package/dist/agent/delegation/interpret.d.ts.map +1 -1
- package/dist/agent/delegation/use-children.d.ts.map +1 -1
- package/dist/agent/format.d.ts +7 -0
- package/dist/agent/format.d.ts.map +1 -1
- package/dist/agent/hooks/thread-queries.d.ts +1548 -0
- package/dist/agent/hooks/thread-queries.d.ts.map +1 -0
- package/dist/agent/hooks/use-agent-conversation.d.ts +51 -6
- package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -1
- package/dist/agent/hooks/use-thread-lists.d.ts +80 -3
- package/dist/agent/hooks/use-thread-lists.d.ts.map +1 -1
- package/dist/agent/hooks/use-thread-place.d.ts +49 -0
- package/dist/agent/hooks/use-thread-place.d.ts.map +1 -0
- package/dist/agent/hooks/use-thread-stream.d.ts.map +1 -1
- package/dist/agent/i18n/en.d.ts +107 -6
- package/dist/agent/i18n/en.d.ts.map +1 -1
- package/dist/agent/i18n/fr.d.ts.map +1 -1
- package/dist/agent/i18n/index.d.ts +180 -12
- package/dist/agent/i18n/index.d.ts.map +1 -1
- package/dist/agent/inbox-handoff.d.ts +10 -0
- package/dist/agent/inbox-handoff.d.ts.map +1 -0
- package/dist/agent/live-run.d.ts +8 -1
- package/dist/agent/live-run.d.ts.map +1 -1
- package/dist/agent/model-selection.d.ts +3 -2
- package/dist/agent/model-selection.d.ts.map +1 -1
- package/dist/agent/moves.d.ts +40 -0
- package/dist/agent/moves.d.ts.map +1 -0
- package/dist/agent/search/interpret.d.ts +101 -0
- package/dist/agent/search/interpret.d.ts.map +1 -0
- package/dist/agent/search/search-tool-view.d.ts +10 -0
- package/dist/agent/search/search-tool-view.d.ts.map +1 -0
- package/dist/agent/thread-reader-state.d.ts +30 -0
- package/dist/agent/thread-reader-state.d.ts.map +1 -0
- package/dist/agent/thread-state.d.ts +26 -0
- package/dist/agent/thread-state.d.ts.map +1 -0
- package/dist/agent/tool-views/built-in.d.ts.map +1 -1
- package/dist/agent/tool-views/registry.d.ts +5 -6
- package/dist/agent/tool-views/registry.d.ts.map +1 -1
- package/dist/agent/types.d.ts +9 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/view-file/view-file-tool-view.d.ts +2 -1
- package/dist/agent/view-file/view-file-tool-view.d.ts.map +1 -1
- package/dist/artifacts/card-preview.d.ts.map +1 -1
- package/dist/artifacts/editor/block-handle.d.ts +20 -0
- package/dist/artifacts/editor/block-handle.d.ts.map +1 -0
- package/dist/artifacts/editor/blocks.d.ts +34 -0
- package/dist/artifacts/editor/blocks.d.ts.map +1 -0
- package/dist/artifacts/editor/callout-view.d.ts +7 -0
- package/dist/artifacts/editor/callout-view.d.ts.map +1 -0
- package/dist/artifacts/editor/document-editor.d.ts +30 -0
- package/dist/artifacts/editor/document-editor.d.ts.map +1 -0
- package/dist/artifacts/editor/figure-view.d.ts +12 -0
- package/dist/artifacts/editor/figure-view.d.ts.map +1 -0
- package/dist/artifacts/editor/find-blocks.d.ts +6 -0
- package/dist/artifacts/editor/find-blocks.d.ts.map +1 -0
- package/dist/artifacts/editor/markdown-document.d.ts +12 -0
- package/dist/artifacts/editor/markdown-document.d.ts.map +1 -0
- package/dist/artifacts/editor/messages.d.ts +4 -0
- package/dist/artifacts/editor/messages.d.ts.map +1 -0
- package/dist/artifacts/editor/schema.d.ts +21 -0
- package/dist/artifacts/editor/schema.d.ts.map +1 -0
- package/dist/artifacts/editor/selection-toolbar.d.ts +35 -0
- package/dist/artifacts/editor/selection-toolbar.d.ts.map +1 -0
- package/dist/artifacts/editor/slash-menu.d.ts +43 -0
- package/dist/artifacts/editor/slash-menu.d.ts.map +1 -0
- package/dist/artifacts/editor/upload.d.ts +12 -0
- package/dist/artifacts/editor/upload.d.ts.map +1 -0
- package/dist/artifacts/file-source.d.ts +5 -0
- package/dist/artifacts/file-source.d.ts.map +1 -1
- package/dist/artifacts/frame-editor/bundle.d.ts +7 -0
- package/dist/artifacts/frame-editor/bundle.d.ts.map +1 -0
- package/dist/artifacts/frame-editor/commands.d.ts +93 -0
- package/dist/artifacts/frame-editor/commands.d.ts.map +1 -0
- package/dist/artifacts/frame-editor/entry.d.ts +2 -0
- package/dist/artifacts/frame-editor/entry.d.ts.map +1 -0
- package/dist/artifacts/frame-editor/frame.d.ts +5 -0
- package/dist/artifacts/frame-editor/frame.d.ts.map +1 -0
- package/dist/artifacts/frame-editor/keys.d.ts +8 -0
- package/dist/artifacts/frame-editor/keys.d.ts.map +1 -0
- package/dist/artifacts/frame-editor/protocol.d.ts +186 -0
- package/dist/artifacts/frame-editor/protocol.d.ts.map +1 -0
- package/dist/artifacts/frame-editor/schema.d.ts +34 -0
- package/dist/artifacts/frame-editor/schema.d.ts.map +1 -0
- package/dist/artifacts/frame-editor/style.d.ts +2 -0
- package/dist/artifacts/frame-editor/style.d.ts.map +1 -0
- package/dist/artifacts/frame.d.ts +2 -2
- package/dist/artifacts/frame.d.ts.map +1 -1
- package/dist/artifacts/live/boards.d.ts +2 -0
- package/dist/artifacts/live/boards.d.ts.map +1 -1
- package/dist/artifacts/live/document.d.ts +32 -0
- package/dist/artifacts/live/document.d.ts.map +1 -0
- package/dist/artifacts/live/header.d.ts +4 -4
- package/dist/artifacts/live/header.d.ts.map +1 -1
- package/dist/artifacts/live/presence.d.ts.map +1 -1
- package/dist/artifacts/live/session.d.ts +2 -0
- package/dist/artifacts/live/session.d.ts.map +1 -1
- package/dist/artifacts/live/view.d.ts +4 -3
- package/dist/artifacts/live/view.d.ts.map +1 -1
- package/dist/artifacts/messages.d.ts +226 -2
- package/dist/artifacts/messages.d.ts.map +1 -1
- package/dist/artifacts/pdf.d.ts +8 -0
- package/dist/artifacts/pdf.d.ts.map +1 -0
- package/dist/artifacts/queries.d.ts +80 -0
- package/dist/artifacts/queries.d.ts.map +1 -1
- package/dist/artifacts/references/references.d.ts +3 -3
- package/dist/artifacts/references/references.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/board-editor.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/comment-pins.d.ts +4 -2
- package/dist/artifacts/renderers/canvas/comment-pins.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/comments-panel.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/comments.d.ts +2 -1
- package/dist/artifacts/renderers/canvas/comments.d.ts.map +1 -1
- package/dist/artifacts/renderers/designed-document.d.ts +28 -0
- package/dist/artifacts/renderers/designed-document.d.ts.map +1 -0
- package/dist/artifacts/renderers/document-tree.d.ts +2 -0
- package/dist/artifacts/renderers/document-tree.d.ts.map +1 -1
- package/dist/artifacts/renderers/document.d.ts +9 -1
- package/dist/artifacts/renderers/document.d.ts.map +1 -1
- package/dist/artifacts/renderers/live-frame.d.ts +145 -0
- package/dist/artifacts/renderers/live-frame.d.ts.map +1 -0
- package/dist/artifacts/renderers/page-editor.d.ts +16 -0
- package/dist/artifacts/renderers/page-editor.d.ts.map +1 -0
- package/dist/artifacts/renderers/page.d.ts +10 -1
- package/dist/artifacts/renderers/page.d.ts.map +1 -1
- package/dist/artifacts/viewer.d.ts.map +1 -1
- package/dist/{chunk-pxd07kvx.js → chunk-096d52h2.js} +1 -1
- package/dist/{chunk-yrcm1pbg.js → chunk-94d7enwc.js} +491 -2128
- package/dist/chunk-94d7enwc.js.map +27 -0
- package/dist/{chunk-970s5nkn.js → chunk-ezntd3yy.js} +1 -1
- package/dist/{chunk-kymx9y5e.js → chunk-qjw5r2vk.js} +12729 -5044
- package/dist/chunk-qjw5r2vk.js.map +242 -0
- package/dist/chunk-y51c4tsz.js +11 -0
- package/dist/chunk-y51c4tsz.js.map +10 -0
- package/dist/createCustomApp.d.ts +8 -1
- package/dist/createCustomApp.d.ts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -6
- package/dist/index.js.map +5 -5
- package/dist/pages/console/data/accounts.d.ts +94 -0
- package/dist/pages/console/data/accounts.d.ts.map +1 -0
- package/dist/pages/console/data/connectors.d.ts.map +1 -1
- package/dist/pages/console/data/live-updates.d.ts.map +1 -1
- package/dist/pages/console/data/messages.d.ts +52 -0
- package/dist/pages/console/data/messages.d.ts.map +1 -1
- package/dist/pages/console/data/shared.d.ts.map +1 -1
- package/dist/pages/console/data/sync-button.d.ts.map +1 -1
- package/dist/pages/console/data/syncs.d.ts.map +1 -1
- package/dist/pages/settings/usage/breakdown.d.ts.map +1 -1
- package/dist/pages/settings/usage/page.d.ts +4 -1
- package/dist/pages/settings/usage/page.d.ts.map +1 -1
- package/dist/pages/settings/usage/spend-model.d.ts +43 -19
- package/dist/pages/settings/usage/spend-model.d.ts.map +1 -1
- package/dist/pages.js +23044 -22570
- package/dist/pages.js.map +17 -16
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +40 -3
- package/dist/server.js.map +3 -3
- package/dist/shell/search-command.d.ts.map +1 -1
- package/package.json +22 -5
- package/src/agent/activity-label.ts +3 -0
- package/src/agent/agent-chat.tsx +58 -39
- package/src/agent/agent-execution-trace.tsx +2 -2
- package/src/agent/agent-panel.tsx +6 -4
- package/src/agent/agent.css +254 -0
- package/src/agent/artifact-panel.tsx +77 -22
- package/src/agent/components/agent-threads.tsx +42 -2
- package/src/agent/components/composer-place.tsx +2 -7
- package/src/agent/components/composer-settings.tsx +20 -10
- package/src/agent/components/composer.tsx +342 -104
- package/src/agent/components/computer-place.tsx +415 -70
- package/src/agent/components/context-meter.tsx +7 -3
- package/src/agent/components/conversation-panel.tsx +99 -54
- package/src/agent/components/message-parts.tsx +367 -59
- package/src/agent/components/message-view.tsx +428 -9
- package/src/agent/components/pending-messages.tsx +342 -0
- package/src/agent/components/sandbox-recovery.tsx +36 -17
- package/src/agent/components/threads-button.tsx +3 -2
- package/src/agent/components/transcript.tsx +198 -38
- package/src/agent/conversation.ts +219 -55
- package/src/agent/delegation/interpret.ts +31 -7
- package/src/agent/format.ts +52 -0
- package/src/agent/hooks/thread-queries.ts +75 -0
- package/src/agent/hooks/use-agent-conversation.ts +801 -211
- package/src/agent/hooks/use-thread-lists.ts +72 -7
- package/src/agent/hooks/use-thread-place.ts +239 -0
- package/src/agent/hooks/use-thread-stream.ts +10 -0
- package/src/agent/i18n/en.ts +150 -27
- package/src/agent/i18n/fr.ts +148 -31
- package/src/agent/inbox-handoff.ts +47 -0
- package/src/agent/live-run.ts +61 -2
- package/src/agent/model-selection.ts +3 -2
- package/src/agent/moves.ts +174 -0
- package/src/agent/react-router.tsx +2 -2
- package/src/agent/search/interpret.ts +367 -0
- package/src/agent/search/search-tool-view.tsx +235 -0
- package/src/agent/thread-reader-state.ts +75 -0
- package/src/agent/thread-state.ts +114 -0
- package/src/agent/tool-views/built-in.tsx +16 -0
- package/src/agent/tool-views/registry.tsx +28 -2
- package/src/agent/types.ts +13 -0
- package/src/agent/view-file/view-file-tool-view.tsx +33 -19
- package/src/artifacts/artifacts.css +398 -0
- package/src/artifacts/card-preview.tsx +6 -1
- package/src/artifacts/editor/block-handle.tsx +278 -0
- package/src/artifacts/editor/blocks.ts +216 -0
- package/src/artifacts/editor/callout-view.tsx +31 -0
- package/src/artifacts/editor/document-editor.tsx +484 -0
- package/src/artifacts/editor/figure-view.tsx +66 -0
- package/src/artifacts/editor/find-blocks.ts +19 -0
- package/src/artifacts/editor/markdown-document.tsx +72 -0
- package/src/artifacts/editor/messages.ts +4 -0
- package/src/artifacts/editor/schema.ts +159 -0
- package/src/artifacts/editor/selection-toolbar.tsx +364 -0
- package/src/artifacts/editor/slash-menu.tsx +251 -0
- package/src/artifacts/editor/upload.ts +40 -0
- package/src/artifacts/file-source.ts +11 -0
- package/src/artifacts/frame-editor/bundle.ts +8 -0
- package/src/artifacts/frame-editor/commands.ts +565 -0
- package/src/artifacts/frame-editor/entry.ts +6 -0
- package/src/artifacts/frame-editor/frame.ts +847 -0
- package/src/artifacts/frame-editor/generated/editor.txt +149 -0
- package/src/artifacts/frame-editor/generated.d.ts +5 -0
- package/src/artifacts/frame-editor/keys.ts +323 -0
- package/src/artifacts/frame-editor/protocol.ts +151 -0
- package/src/artifacts/frame-editor/schema.ts +293 -0
- package/src/artifacts/frame-editor/style.ts +58 -0
- package/src/artifacts/frame.tsx +11 -3
- package/src/artifacts/live/boards.ts +46 -3
- package/src/artifacts/live/document.ts +89 -0
- package/src/artifacts/live/header.tsx +9 -14
- package/src/artifacts/live/presence.ts +5 -1
- package/src/artifacts/live/session.ts +9 -2
- package/src/artifacts/live/view.ts +14 -8
- package/src/artifacts/messages.ts +138 -2
- package/src/artifacts/pdf.ts +50 -0
- package/src/artifacts/references/references.tsx +46 -11
- package/src/artifacts/renderers/canvas/board-editor.tsx +11 -144
- package/src/artifacts/renderers/canvas/comment-pins.tsx +5 -0
- package/src/artifacts/renderers/canvas/comments-panel.tsx +58 -1
- package/src/artifacts/renderers/canvas/comments.ts +8 -4
- package/src/artifacts/renderers/designed-document.tsx +277 -0
- package/src/artifacts/renderers/document-tree.ts +9 -0
- package/src/artifacts/renderers/document.tsx +13 -102
- package/src/artifacts/renderers/live-frame.ts +163 -0
- package/src/artifacts/renderers/page-editor.tsx +613 -0
- package/src/artifacts/renderers/page.tsx +21 -4
- package/src/artifacts/viewer.tsx +87 -41
- package/src/createCustomApp.ts +57 -3
- package/src/index.ts +10 -0
- package/src/pages/console/data/accounts.tsx +509 -0
- package/src/pages/console/data/connectors.tsx +7 -15
- package/src/pages/console/data/live-updates.ts +2 -0
- package/src/pages/console/data/messages.ts +79 -0
- package/src/pages/console/data/projections.tsx +4 -0
- package/src/pages/console/data/shared.tsx +1 -0
- package/src/pages/console/data/sync-button.tsx +56 -16
- package/src/pages/console/data/syncs.tsx +66 -41
- package/src/pages/console/ontology/lineage/trail.tsx +3 -0
- package/src/pages/section-ui.tsx +1 -1
- package/src/pages/settings/usage/breakdown.tsx +5 -2
- package/src/pages/settings/usage/filter-menu.tsx +1 -1
- package/src/pages/settings/usage/page.tsx +32 -13
- package/src/pages/settings/usage/spend-chart.tsx +2 -2
- package/src/pages/settings/usage/spend-model.ts +118 -50
- package/src/server.ts +1 -0
- package/src/shell/search-command.tsx +2 -0
- package/dist/chunk-kymx9y5e.js.map +0 -211
- package/dist/chunk-yrcm1pbg.js.map +0 -34
- /package/dist/{chunk-pxd07kvx.js.map → chunk-096d52h2.js.map} +0 -0
- /package/dist/{chunk-970s5nkn.js.map → chunk-ezntd3yy.js.map} +0 -0
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
import type { ListConnectorAccountsResponse, ListSyncsResponse } from "@sixb/client"
|
|
2
|
+
import {
|
|
3
|
+
listConnectorAccountsOptions,
|
|
4
|
+
listConnectorAccountsQueryKey,
|
|
5
|
+
listSyncRunsQueryKey,
|
|
6
|
+
listSyncsQueryKey,
|
|
7
|
+
requestSyncRunMutation,
|
|
8
|
+
} from "@sixb/client/hooks"
|
|
9
|
+
import { Button, Input } from "@sixb/ui/components"
|
|
10
|
+
import { cn } from "@sixb/ui/lib/utils"
|
|
11
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"
|
|
12
|
+
import { Building2, RefreshCw, Search, Users } from "lucide-react"
|
|
13
|
+
import { Fragment, useState } from "react"
|
|
14
|
+
import { Link } from "react-router-dom"
|
|
15
|
+
import {
|
|
16
|
+
apiErrorMessage,
|
|
17
|
+
FailureSummary,
|
|
18
|
+
humanize,
|
|
19
|
+
IconTile,
|
|
20
|
+
MetaDot,
|
|
21
|
+
PageSection,
|
|
22
|
+
Panel,
|
|
23
|
+
PanelEmpty,
|
|
24
|
+
PanelRow,
|
|
25
|
+
PanelSkeleton,
|
|
26
|
+
Pill,
|
|
27
|
+
RunStatusPill,
|
|
28
|
+
useFormat,
|
|
29
|
+
useNumbers,
|
|
30
|
+
useRunStatusLabels,
|
|
31
|
+
} from "../../section-ui"
|
|
32
|
+
import { PersonAvatar } from "../../settings/controls"
|
|
33
|
+
import { TrailingSkeleton } from "../skeletons"
|
|
34
|
+
import { useDataMessages } from "./messages"
|
|
35
|
+
|
|
36
|
+
type ConnectorAccount = ListConnectorAccountsResponse["accounts"][number]
|
|
37
|
+
type AccountRun = ConnectorAccount["latestRuns"][number]
|
|
38
|
+
type Sync = ListSyncsResponse[number]
|
|
39
|
+
type AccountsSummary = NonNullable<Sync["accounts"]>
|
|
40
|
+
|
|
41
|
+
/** How many accounts show before "Show all". Problems sort first, so they always show. */
|
|
42
|
+
const SHOWN_ACCOUNTS = 8
|
|
43
|
+
/** Past this many accounts, the panel offers a search. */
|
|
44
|
+
const SEARCHABLE_ACCOUNTS = 20
|
|
45
|
+
|
|
46
|
+
export function isActiveRun(status: AccountRun["status"] | undefined): boolean {
|
|
47
|
+
return status === "queued" || status === "running"
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function needsReconnecting(run: AccountRun | null | undefined): boolean {
|
|
51
|
+
return run?.status === "failed" && run.error?.code === "connector.authorization_required"
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** The connector's accounts, kept fresh while one of their runs is under way. */
|
|
55
|
+
export function useConnectorAccounts(connectorId: string, enabled = true) {
|
|
56
|
+
return useQuery({
|
|
57
|
+
...listConnectorAccountsOptions({ path: { connectorId } }),
|
|
58
|
+
enabled,
|
|
59
|
+
retry: false,
|
|
60
|
+
refetchInterval: (query) =>
|
|
61
|
+
query.state.data?.accounts.some(({ latestRuns }) =>
|
|
62
|
+
latestRuns.some((run) => isActiveRun(run.status))
|
|
63
|
+
)
|
|
64
|
+
? 5000
|
|
65
|
+
: false,
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
type AccountState = "reconnect" | "failed" | "running" | "never" | "synced"
|
|
70
|
+
|
|
71
|
+
const stateOrder: Record<AccountState, number> = {
|
|
72
|
+
reconnect: 0,
|
|
73
|
+
failed: 1,
|
|
74
|
+
running: 2,
|
|
75
|
+
never: 3,
|
|
76
|
+
synced: 4,
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** One state for an account across its syncs: what most needs someone's attention. */
|
|
80
|
+
function accountState(account: ConnectorAccount): AccountState {
|
|
81
|
+
const runs = account.latestRuns
|
|
82
|
+
if (runs.some(needsReconnecting)) return "reconnect"
|
|
83
|
+
if (runs.some((run) => run.status === "failed")) return "failed"
|
|
84
|
+
if (runs.some((run) => isActiveRun(run.status))) return "running"
|
|
85
|
+
return runs.length === 0 ? "never" : "synced"
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* A sync of an OAuth connector as one state, from the accounts you see. Its latest run only says
|
|
90
|
+
* how the account that ran last went.
|
|
91
|
+
*/
|
|
92
|
+
type SyncAccountsState = "running" | "attention" | "synced" | "never" | "empty"
|
|
93
|
+
|
|
94
|
+
function syncAccountsState(summary: AccountsSummary): SyncAccountsState {
|
|
95
|
+
if (summary.running > 0) return "running"
|
|
96
|
+
if (summary.needsReconnecting + summary.failing > 0) return "attention"
|
|
97
|
+
if (summary.synced > 0) return "synced"
|
|
98
|
+
|
|
99
|
+
return summary.total === 0 ? "empty" : "never"
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** The pill of a sync of an OAuth connector, on its row and its page. */
|
|
103
|
+
function AccountsStatusPill({ summary }: { readonly summary: AccountsSummary }) {
|
|
104
|
+
const messages = useDataMessages()
|
|
105
|
+
|
|
106
|
+
switch (syncAccountsState(summary)) {
|
|
107
|
+
case "running":
|
|
108
|
+
return <RunStatusPill status="running" />
|
|
109
|
+
case "attention":
|
|
110
|
+
return (
|
|
111
|
+
<Pill tone={summary.failing > 0 ? "error" : "warn"}>{messages.syncs.needsAttention}</Pill>
|
|
112
|
+
)
|
|
113
|
+
case "synced":
|
|
114
|
+
return <RunStatusPill status="succeeded" />
|
|
115
|
+
case "empty":
|
|
116
|
+
return <Pill tone="muted">{messages.syncs.noAccounts}</Pill>
|
|
117
|
+
case "never":
|
|
118
|
+
return <Pill tone="muted">{messages.common.neverRun}</Pill>
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* How a sync stands: its latest run, or on a sync of an OAuth connector, its accounts. There, the
|
|
124
|
+
* latest run is only the account that ran last.
|
|
125
|
+
*/
|
|
126
|
+
export function SyncStatusPill({ sync }: { readonly sync: Sync }) {
|
|
127
|
+
const messages = useDataMessages()
|
|
128
|
+
if (sync.accounts) return <AccountsStatusPill summary={sync.accounts} />
|
|
129
|
+
|
|
130
|
+
return sync.latestRun ? (
|
|
131
|
+
<RunStatusPill status={sync.latestRun.status} />
|
|
132
|
+
) : (
|
|
133
|
+
<Pill tone="muted">{messages.common.neverRun}</Pill>
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** On a sync's row: when it last ran, or on a sync of an OAuth connector, when an account synced. */
|
|
138
|
+
export function SyncTimeMeta({ sync }: { readonly sync: Sync }) {
|
|
139
|
+
const format = useFormat()
|
|
140
|
+
const at = sync.accounts
|
|
141
|
+
? sync.accounts.lastSyncedAt
|
|
142
|
+
: (sync.latestRun?.startedAt ?? sync.latestRun?.queuedAt)
|
|
143
|
+
if (!at) return null
|
|
144
|
+
|
|
145
|
+
return (
|
|
146
|
+
<>
|
|
147
|
+
<MetaDot />
|
|
148
|
+
<span>{format.relative(at)}</span>
|
|
149
|
+
</>
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* A sync of an OAuth connector's figures: its accounts, rather than the run that ended last. Null
|
|
155
|
+
* for a sync of any other connector.
|
|
156
|
+
*/
|
|
157
|
+
export function useAccountsStats(summary: AccountsSummary | undefined) {
|
|
158
|
+
const messages = useDataMessages().syncs
|
|
159
|
+
const numbers = useNumbers()
|
|
160
|
+
const format = useFormat()
|
|
161
|
+
if (!summary) return null
|
|
162
|
+
|
|
163
|
+
const attention = summary.needsReconnecting + summary.failing
|
|
164
|
+
|
|
165
|
+
return [
|
|
166
|
+
{ label: messages.accountsStat, value: numbers.count(summary.total) },
|
|
167
|
+
{ label: messages.syncedStat, value: numbers.count(summary.synced) },
|
|
168
|
+
{
|
|
169
|
+
label: messages.attentionStat,
|
|
170
|
+
value: (
|
|
171
|
+
<span
|
|
172
|
+
className={cn(
|
|
173
|
+
summary.failing > 0
|
|
174
|
+
? "text-red-600 dark:text-red-400"
|
|
175
|
+
: attention > 0 && "text-amber-700 dark:text-amber-400"
|
|
176
|
+
)}
|
|
177
|
+
>
|
|
178
|
+
{numbers.count(attention)}
|
|
179
|
+
</span>
|
|
180
|
+
),
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
label: messages.lastSynced,
|
|
184
|
+
value: summary.lastSyncedAt ? format.relative(summary.lastSyncedAt) : "—",
|
|
185
|
+
},
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** On a sync's row or page: how many accounts it runs for, and how many are not syncing. */
|
|
190
|
+
export function AccountsMeta({
|
|
191
|
+
summary,
|
|
192
|
+
href,
|
|
193
|
+
}: {
|
|
194
|
+
readonly summary: NonNullable<Sync["accounts"]>
|
|
195
|
+
/** The connector's accounts, when the count should lead there. */
|
|
196
|
+
readonly href?: string
|
|
197
|
+
}) {
|
|
198
|
+
const messages = useDataMessages().syncs
|
|
199
|
+
const numbers = useNumbers()
|
|
200
|
+
const count = (
|
|
201
|
+
<span className="inline-flex items-center gap-1">
|
|
202
|
+
<Users aria-hidden className="size-3.5" />
|
|
203
|
+
{messages.accounts(summary.total, numbers.count(summary.total))}
|
|
204
|
+
</span>
|
|
205
|
+
)
|
|
206
|
+
return (
|
|
207
|
+
<>
|
|
208
|
+
<MetaDot />
|
|
209
|
+
{href ? (
|
|
210
|
+
<Link to={href} className="hover:text-foreground hover:underline">
|
|
211
|
+
{count}
|
|
212
|
+
</Link>
|
|
213
|
+
) : (
|
|
214
|
+
count
|
|
215
|
+
)}
|
|
216
|
+
{summary.needsReconnecting > 0 ? (
|
|
217
|
+
<>
|
|
218
|
+
<MetaDot />
|
|
219
|
+
<span className="text-amber-700 dark:text-amber-400">
|
|
220
|
+
{messages.needReconnecting(summary.needsReconnecting)}
|
|
221
|
+
</span>
|
|
222
|
+
</>
|
|
223
|
+
) : null}
|
|
224
|
+
{summary.failing > 0 ? (
|
|
225
|
+
<>
|
|
226
|
+
<MetaDot />
|
|
227
|
+
<span className="text-red-600 dark:text-red-400">
|
|
228
|
+
{messages.failingAccounts(summary.failing)}
|
|
229
|
+
</span>
|
|
230
|
+
</>
|
|
231
|
+
) : null}
|
|
232
|
+
</>
|
|
233
|
+
)
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/** An OAuth connector's connected accounts, the ones that need attention first. */
|
|
237
|
+
export function ConnectorAccountsSection({
|
|
238
|
+
connectorId,
|
|
239
|
+
syncs,
|
|
240
|
+
}: {
|
|
241
|
+
readonly connectorId: string
|
|
242
|
+
/** The connector's syncs the viewer may run. */
|
|
243
|
+
readonly syncs: readonly Sync[]
|
|
244
|
+
}) {
|
|
245
|
+
const messages = useDataMessages()
|
|
246
|
+
const numbers = useNumbers()
|
|
247
|
+
const query = useConnectorAccounts(connectorId)
|
|
248
|
+
const [showAll, setShowAll] = useState(false)
|
|
249
|
+
const [search, setSearch] = useState("")
|
|
250
|
+
|
|
251
|
+
const accounts = [...(query.data?.accounts ?? [])].sort(
|
|
252
|
+
(left, right) =>
|
|
253
|
+
stateOrder[accountState(left)] - stateOrder[accountState(right)] ||
|
|
254
|
+
left.connection.account.label.localeCompare(right.connection.account.label)
|
|
255
|
+
)
|
|
256
|
+
const needle = search.trim().toLowerCase()
|
|
257
|
+
const matching = needle
|
|
258
|
+
? accounts.filter(({ connection }) => connection.account.label.toLowerCase().includes(needle))
|
|
259
|
+
: accounts
|
|
260
|
+
const shown = showAll || needle ? matching : matching.slice(0, SHOWN_ACCOUNTS)
|
|
261
|
+
|
|
262
|
+
return (
|
|
263
|
+
<PageSection
|
|
264
|
+
title={messages.connectors.accountsTitle}
|
|
265
|
+
description={messages.connectors.accountsDescription}
|
|
266
|
+
action={
|
|
267
|
+
accounts.length > SEARCHABLE_ACCOUNTS ? (
|
|
268
|
+
<div className="relative w-56">
|
|
269
|
+
<Search className="pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground" />
|
|
270
|
+
<Input
|
|
271
|
+
type="search"
|
|
272
|
+
value={search}
|
|
273
|
+
onChange={(event) => setSearch(event.target.value)}
|
|
274
|
+
placeholder={messages.connectors.searchAccounts}
|
|
275
|
+
aria-label={messages.connectors.searchAccounts}
|
|
276
|
+
className="h-8 pl-8 text-xs"
|
|
277
|
+
/>
|
|
278
|
+
</div>
|
|
279
|
+
) : null
|
|
280
|
+
}
|
|
281
|
+
>
|
|
282
|
+
<Panel>
|
|
283
|
+
{query.isPending ? (
|
|
284
|
+
<PanelSkeleton rows={2} leading="avatar" trailing={<TrailingSkeleton />} />
|
|
285
|
+
) : query.isError ? (
|
|
286
|
+
<PanelEmpty
|
|
287
|
+
tone="error"
|
|
288
|
+
icon={Users}
|
|
289
|
+
title={messages.connectors.accountsTitle}
|
|
290
|
+
description={apiErrorMessage(query.error, messages.common.loadFailed)}
|
|
291
|
+
/>
|
|
292
|
+
) : accounts.length === 0 ? (
|
|
293
|
+
<PanelEmpty icon={Users} title={messages.connectors.noAccountsTitle} />
|
|
294
|
+
) : matching.length === 0 ? (
|
|
295
|
+
<PanelEmpty icon={Search} title={messages.connectors.noMatchingAccounts} />
|
|
296
|
+
) : (
|
|
297
|
+
<>
|
|
298
|
+
{shown.map((account) => (
|
|
299
|
+
<AccountRow
|
|
300
|
+
key={account.connection.id}
|
|
301
|
+
connectorId={connectorId}
|
|
302
|
+
account={account}
|
|
303
|
+
syncs={syncs}
|
|
304
|
+
/>
|
|
305
|
+
))}
|
|
306
|
+
{shown.length < matching.length ? (
|
|
307
|
+
<button
|
|
308
|
+
type="button"
|
|
309
|
+
onClick={() => setShowAll(true)}
|
|
310
|
+
className="w-full px-4 py-3 text-left text-[0.8125rem] text-muted-foreground transition-colors hover:bg-muted/40 hover:text-foreground"
|
|
311
|
+
>
|
|
312
|
+
{messages.connectors.showAllAccounts(numbers.count(matching.length))}
|
|
313
|
+
</button>
|
|
314
|
+
) : null}
|
|
315
|
+
</>
|
|
316
|
+
)}
|
|
317
|
+
</Panel>
|
|
318
|
+
</PageSection>
|
|
319
|
+
)
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function AccountRow({
|
|
323
|
+
connectorId,
|
|
324
|
+
account,
|
|
325
|
+
syncs,
|
|
326
|
+
}: {
|
|
327
|
+
readonly connectorId: string
|
|
328
|
+
readonly account: ConnectorAccount
|
|
329
|
+
readonly syncs: readonly Sync[]
|
|
330
|
+
}) {
|
|
331
|
+
const messages = useDataMessages()
|
|
332
|
+
const format = useFormat()
|
|
333
|
+
const numbers = useNumbers()
|
|
334
|
+
const { connection, latestRuns } = account
|
|
335
|
+
const label = connection.account.label
|
|
336
|
+
const isProject = connection.owner.type === "project"
|
|
337
|
+
const state = accountState(account)
|
|
338
|
+
const failure = latestRuns.find((run) => run.status === "failed" && !needsReconnecting(run))
|
|
339
|
+
const when = (run: AccountRun) => format.relative(run.finishedAt ?? run.startedAt ?? run.queuedAt)
|
|
340
|
+
const [onlyRun] = latestRuns
|
|
341
|
+
|
|
342
|
+
return (
|
|
343
|
+
<PanelRow
|
|
344
|
+
leading={isProject ? <IconTile icon={Building2} /> : <PersonAvatar email={label} />}
|
|
345
|
+
// A narrow screen wraps the address rather than cut it: it says whose account this is.
|
|
346
|
+
title={<span className="min-w-0 wrap-anywhere sm:truncate">{label}</span>}
|
|
347
|
+
meta={
|
|
348
|
+
<>
|
|
349
|
+
<NarrowAccountState state={state} />
|
|
350
|
+
{isProject ? (
|
|
351
|
+
<>
|
|
352
|
+
<span>{messages.syncs.project}</span>
|
|
353
|
+
<MetaDot />
|
|
354
|
+
</>
|
|
355
|
+
) : null}
|
|
356
|
+
{connection.slot !== "default" ? (
|
|
357
|
+
<>
|
|
358
|
+
<span>{messages.syncs.slot(connection.slot)}</span>
|
|
359
|
+
<MetaDot />
|
|
360
|
+
</>
|
|
361
|
+
) : null}
|
|
362
|
+
{latestRuns.length === 0 ? (
|
|
363
|
+
<span>{messages.syncs.notSyncedYet}</span>
|
|
364
|
+
) : syncs.length <= 1 && onlyRun ? (
|
|
365
|
+
// One sync: when it last ran, and what it read.
|
|
366
|
+
<>
|
|
367
|
+
<span>{when(onlyRun)}</span>
|
|
368
|
+
{onlyRun.rowsRead !== undefined ? (
|
|
369
|
+
<>
|
|
370
|
+
<MetaDot />
|
|
371
|
+
<span className="tabular-nums">
|
|
372
|
+
{messages.common.rows(onlyRun.rowsRead, numbers.count(onlyRun.rowsRead))}
|
|
373
|
+
</span>
|
|
374
|
+
</>
|
|
375
|
+
) : null}
|
|
376
|
+
</>
|
|
377
|
+
) : (
|
|
378
|
+
// Several syncs: each one's last run, by name. Stacked on a narrow screen.
|
|
379
|
+
<span className="flex min-w-0 flex-col sm:flex-row sm:flex-wrap sm:items-center sm:gap-x-1.5">
|
|
380
|
+
{latestRuns.map((run, index) => (
|
|
381
|
+
<Fragment key={run.syncId}>
|
|
382
|
+
{index > 0 ? (
|
|
383
|
+
<span className="hidden sm:inline">
|
|
384
|
+
<MetaDot />
|
|
385
|
+
</span>
|
|
386
|
+
) : null}
|
|
387
|
+
<span
|
|
388
|
+
className={cn(
|
|
389
|
+
"truncate",
|
|
390
|
+
needsReconnecting(run)
|
|
391
|
+
? "text-amber-700 dark:text-amber-400"
|
|
392
|
+
: run.status === "failed" && "text-red-600 dark:text-red-400"
|
|
393
|
+
)}
|
|
394
|
+
>
|
|
395
|
+
{humanize(run.syncId)} {when(run)}
|
|
396
|
+
</span>
|
|
397
|
+
</Fragment>
|
|
398
|
+
))}
|
|
399
|
+
</span>
|
|
400
|
+
)}
|
|
401
|
+
</>
|
|
402
|
+
}
|
|
403
|
+
trailing={
|
|
404
|
+
<>
|
|
405
|
+
<AccountSyncButton connectorId={connectorId} account={account} syncs={syncs} />
|
|
406
|
+
<span className="hidden sm:inline-flex">
|
|
407
|
+
{state === "never" ? (
|
|
408
|
+
<Pill tone="muted">{messages.syncs.notSyncedYet}</Pill>
|
|
409
|
+
) : state === "reconnect" ? (
|
|
410
|
+
<Pill tone="warn">{messages.syncs.needsReconnecting}</Pill>
|
|
411
|
+
) : (
|
|
412
|
+
<RunStatusPill
|
|
413
|
+
status={
|
|
414
|
+
state === "failed" ? "failed" : state === "running" ? "running" : "succeeded"
|
|
415
|
+
}
|
|
416
|
+
/>
|
|
417
|
+
)}
|
|
418
|
+
</span>
|
|
419
|
+
</>
|
|
420
|
+
}
|
|
421
|
+
>
|
|
422
|
+
{failure?.error ? <FailureSummary failure={failure.error} compact /> : null}
|
|
423
|
+
</PanelRow>
|
|
424
|
+
)
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
const narrowStates = {
|
|
428
|
+
reconnect: { dot: "bg-amber-500", text: "text-amber-700 dark:text-amber-400" },
|
|
429
|
+
failed: { dot: "bg-red-500", text: "text-red-600 dark:text-red-400" },
|
|
430
|
+
running: { dot: "bg-sky-500", text: "text-foreground/75" },
|
|
431
|
+
} as const
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* On a narrow screen, an account's state gets its own line under the address instead of taking
|
|
435
|
+
* the row's right side, which leaves the address room. A synced account says nothing, and one
|
|
436
|
+
* never synced says so already.
|
|
437
|
+
*/
|
|
438
|
+
function NarrowAccountState({ state }: { readonly state: AccountState }) {
|
|
439
|
+
const messages = useDataMessages().syncs
|
|
440
|
+
const statusLabels = useRunStatusLabels()
|
|
441
|
+
if (state !== "reconnect" && state !== "failed" && state !== "running") return null
|
|
442
|
+
|
|
443
|
+
const tone = narrowStates[state]
|
|
444
|
+
const label = state === "reconnect" ? messages.needsReconnecting : statusLabels[state]
|
|
445
|
+
|
|
446
|
+
return (
|
|
447
|
+
<span className={cn("flex w-full items-center gap-1.5 font-medium sm:hidden", tone.text)}>
|
|
448
|
+
<span aria-hidden className={cn("size-1.5 rounded-full", tone.dot)} />
|
|
449
|
+
{label}
|
|
450
|
+
</span>
|
|
451
|
+
)
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/** Runs every sync of one account now. Shown on hover, and always on touch screens. */
|
|
455
|
+
function AccountSyncButton({
|
|
456
|
+
connectorId,
|
|
457
|
+
account,
|
|
458
|
+
syncs,
|
|
459
|
+
}: {
|
|
460
|
+
readonly connectorId: string
|
|
461
|
+
readonly account: ConnectorAccount
|
|
462
|
+
readonly syncs: readonly Sync[]
|
|
463
|
+
}) {
|
|
464
|
+
const messages = useDataMessages().syncs
|
|
465
|
+
const queryClient = useQueryClient()
|
|
466
|
+
const label = account.connection.account.label
|
|
467
|
+
const request = useMutation({
|
|
468
|
+
...requestSyncRunMutation(),
|
|
469
|
+
onSuccess: () =>
|
|
470
|
+
Promise.all([
|
|
471
|
+
queryClient.invalidateQueries({
|
|
472
|
+
queryKey: listConnectorAccountsQueryKey({ path: { connectorId } }),
|
|
473
|
+
}),
|
|
474
|
+
queryClient.invalidateQueries({ queryKey: listSyncsQueryKey() }),
|
|
475
|
+
queryClient.invalidateQueries({ queryKey: listSyncRunsQueryKey() }),
|
|
476
|
+
]),
|
|
477
|
+
})
|
|
478
|
+
const working = request.isPending || account.latestRuns.some((run) => isActiveRun(run.status))
|
|
479
|
+
if (syncs.length === 0) return null
|
|
480
|
+
|
|
481
|
+
return (
|
|
482
|
+
<Button
|
|
483
|
+
type="button"
|
|
484
|
+
variant="ghost"
|
|
485
|
+
size="icon-sm"
|
|
486
|
+
aria-label={messages.syncAccount(label)}
|
|
487
|
+
title={messages.syncAccount(label)}
|
|
488
|
+
disabled={working}
|
|
489
|
+
onClick={async () => {
|
|
490
|
+
// One sync refusing, such as one this person may not run, leaves the others to run.
|
|
491
|
+
for (const sync of syncs) {
|
|
492
|
+
await request
|
|
493
|
+
.mutateAsync({
|
|
494
|
+
path: { syncId: sync.id },
|
|
495
|
+
body: { connectionId: account.connection.id },
|
|
496
|
+
})
|
|
497
|
+
.catch(() => undefined)
|
|
498
|
+
}
|
|
499
|
+
}}
|
|
500
|
+
className={cn(
|
|
501
|
+
"text-muted-foreground transition-opacity",
|
|
502
|
+
!working &&
|
|
503
|
+
"focus-visible:opacity-100 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover:opacity-100"
|
|
504
|
+
)}
|
|
505
|
+
>
|
|
506
|
+
<RefreshCw className={cn(working && "animate-spin")} />
|
|
507
|
+
</Button>
|
|
508
|
+
)
|
|
509
|
+
}
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
useNumbers,
|
|
31
31
|
} from "../../section-ui"
|
|
32
32
|
import { MetaSkeleton, SkeletonBlock, TrailingSkeleton } from "../skeletons"
|
|
33
|
+
import { ConnectorAccountsSection, SyncStatusPill, SyncTimeMeta } from "./accounts"
|
|
33
34
|
import { useDataMessages } from "./messages"
|
|
34
35
|
import { ConnectorIcon } from "./shared"
|
|
35
36
|
|
|
@@ -196,29 +197,20 @@ export function ConsoleConnectorPage() {
|
|
|
196
197
|
meta={
|
|
197
198
|
<>
|
|
198
199
|
<span>{messages.common.writes(sync.target.dataset.id)}</span>
|
|
199
|
-
{sync
|
|
200
|
-
<>
|
|
201
|
-
<MetaDot />
|
|
202
|
-
<span>
|
|
203
|
-
{format.relative(sync.latestRun.startedAt ?? sync.latestRun.queuedAt)}
|
|
204
|
-
</span>
|
|
205
|
-
</>
|
|
206
|
-
) : null}
|
|
200
|
+
<SyncTimeMeta sync={sync} />
|
|
207
201
|
</>
|
|
208
202
|
}
|
|
209
|
-
trailing={
|
|
210
|
-
sync.latestRun ? (
|
|
211
|
-
<RunStatusPill status={sync.latestRun.status} />
|
|
212
|
-
) : (
|
|
213
|
-
<Pill tone="muted">{messages.common.neverRun}</Pill>
|
|
214
|
-
)
|
|
215
|
-
}
|
|
203
|
+
trailing={<SyncStatusPill sync={sync} />}
|
|
216
204
|
/>
|
|
217
205
|
))
|
|
218
206
|
)}
|
|
219
207
|
</Panel>
|
|
220
208
|
</PageSection>
|
|
221
209
|
|
|
210
|
+
{connector.connection && syncs.length > 0 ? (
|
|
211
|
+
<ConnectorAccountsSection connectorId={connector.id} syncs={syncs} />
|
|
212
|
+
) : null}
|
|
213
|
+
|
|
222
214
|
{webhooks.length > 0 ? (
|
|
223
215
|
<>
|
|
224
216
|
<PageSection
|
|
@@ -27,6 +27,8 @@ export function useSyncLiveUpdates(options: { syncId?: string } = {}) {
|
|
|
27
27
|
key("listSyncs"),
|
|
28
28
|
key("listSyncRuns"),
|
|
29
29
|
key("getSync", { syncId: event.payload.syncId }),
|
|
30
|
+
// Which connector a sync reads isn't in its events: refresh every connector's accounts.
|
|
31
|
+
key("listConnectorAccounts"),
|
|
30
32
|
]
|
|
31
33
|
if ("datasetId" in event.payload && event.payload.datasetId) {
|
|
32
34
|
keys.push(...datasetChangedKeys(event.payload.datasetId))
|
|
@@ -41,6 +41,17 @@ export const en = {
|
|
|
41
41
|
synced: (when: string) => `Synced ${when}`,
|
|
42
42
|
failed: "Last sync failed",
|
|
43
43
|
never: "Never synced",
|
|
44
|
+
noAccounts: "No account connected",
|
|
45
|
+
accountsNeedReconnecting: (count: number) =>
|
|
46
|
+
plural("en", count, {
|
|
47
|
+
one: "An account needs reconnecting",
|
|
48
|
+
other: `${count} accounts need reconnecting`,
|
|
49
|
+
}),
|
|
50
|
+
accountsFailed: (count: number) =>
|
|
51
|
+
plural("en", count, {
|
|
52
|
+
one: "An account failed to sync",
|
|
53
|
+
other: `${count} accounts failed to sync`,
|
|
54
|
+
}),
|
|
44
55
|
requestFailed: "The sync could not be started.",
|
|
45
56
|
},
|
|
46
57
|
connectors: {
|
|
@@ -52,6 +63,12 @@ export const en = {
|
|
|
52
63
|
webhookCount: (count: number) =>
|
|
53
64
|
plural("en", count, { one: "1 webhook", other: `${count} webhooks` }),
|
|
54
65
|
oauth: "Connects with OAuth",
|
|
66
|
+
accountsTitle: "Accounts",
|
|
67
|
+
accountsDescription: "Each connected account, and how its syncs last ran.",
|
|
68
|
+
noAccountsTitle: "No accounts connected",
|
|
69
|
+
searchAccounts: "Search accounts",
|
|
70
|
+
noMatchingAccounts: "No accounts match",
|
|
71
|
+
showAllAccounts: (count: string) => `Show all ${count} accounts`,
|
|
55
72
|
syncsTitle: "Syncs",
|
|
56
73
|
syncsDescription: "What this connector copies into the project.",
|
|
57
74
|
noSyncsTitle: "No syncs",
|
|
@@ -80,6 +97,25 @@ export const en = {
|
|
|
80
97
|
connector: "Connector",
|
|
81
98
|
dataset: "Dataset",
|
|
82
99
|
runWhat: "Sync runs",
|
|
100
|
+
accounts: (count: number, formatted: string) =>
|
|
101
|
+
plural("en", count, { one: `${formatted} account`, other: `${formatted} accounts` }),
|
|
102
|
+
needReconnecting: (count: number) =>
|
|
103
|
+
plural("en", count, {
|
|
104
|
+
one: "1 needs reconnecting",
|
|
105
|
+
other: `${count} need reconnecting`,
|
|
106
|
+
}),
|
|
107
|
+
failingAccounts: (count: number) => `${count} failing`,
|
|
108
|
+
project: "Project",
|
|
109
|
+
slot: (slot: string) => `Slot ${slot}`,
|
|
110
|
+
notSyncedYet: "Not synced yet",
|
|
111
|
+
needsReconnecting: "Needs reconnecting",
|
|
112
|
+
syncAccount: (account: string) => `Sync ${account}`,
|
|
113
|
+
needsAttention: "Needs attention",
|
|
114
|
+
noAccounts: "No accounts",
|
|
115
|
+
accountsStat: "Accounts",
|
|
116
|
+
syncedStat: "Synced",
|
|
117
|
+
attentionStat: "Need attention",
|
|
118
|
+
lastSynced: "Last synced",
|
|
83
119
|
},
|
|
84
120
|
datasets: {
|
|
85
121
|
title: "Datasets",
|
|
@@ -232,6 +268,9 @@ export const en = {
|
|
|
232
268
|
conflict: "On conflict",
|
|
233
269
|
editsWin: "Edits made in Sixb win",
|
|
234
270
|
mostRecent: (column: string) => `The most recent row wins, by ${column}`,
|
|
271
|
+
missing: "When a row disappears",
|
|
272
|
+
missingRemove: "Its object goes, even one created in Sixb",
|
|
273
|
+
missingKeep: "Objects created in Sixb stay",
|
|
235
274
|
rowsRead: "Rows read",
|
|
236
275
|
rowsSkipped: (_count: number, formatted: string) => `${formatted} skipped`,
|
|
237
276
|
runWhat: "Projection runs",
|
|
@@ -280,6 +319,17 @@ export const fr: Translation<DataMessages> = {
|
|
|
280
319
|
synced: (when: string) => `Synchronisé ${when}`,
|
|
281
320
|
failed: "La dernière synchronisation a échoué",
|
|
282
321
|
never: "Jamais synchronisé",
|
|
322
|
+
noAccounts: "Aucun compte connecté",
|
|
323
|
+
accountsNeedReconnecting: (count: number) =>
|
|
324
|
+
plural("fr", count, {
|
|
325
|
+
one: "Un compte à reconnecter",
|
|
326
|
+
other: `${count} comptes à reconnecter`,
|
|
327
|
+
}),
|
|
328
|
+
accountsFailed: (count: number) =>
|
|
329
|
+
plural("fr", count, {
|
|
330
|
+
one: "Un compte en échec",
|
|
331
|
+
other: `${count} comptes en échec`,
|
|
332
|
+
}),
|
|
283
333
|
requestFailed: "Impossible de lancer la synchronisation.",
|
|
284
334
|
},
|
|
285
335
|
connectors: {
|
|
@@ -292,6 +342,12 @@ export const fr: Translation<DataMessages> = {
|
|
|
292
342
|
webhookCount: (count: number) =>
|
|
293
343
|
plural("fr", count, { one: "1 webhook", other: `${count} webhooks` }),
|
|
294
344
|
oauth: "Se connecte avec OAuth",
|
|
345
|
+
accountsTitle: "Comptes",
|
|
346
|
+
accountsDescription: "Chaque compte connecté, et le dernier passage de ses synchronisations.",
|
|
347
|
+
noAccountsTitle: "Aucun compte connecté",
|
|
348
|
+
searchAccounts: "Rechercher un compte",
|
|
349
|
+
noMatchingAccounts: "Aucun compte ne correspond",
|
|
350
|
+
showAllAccounts: (count: string) => `Afficher les ${count} comptes`,
|
|
295
351
|
syncsTitle: "Synchronisations",
|
|
296
352
|
syncsDescription: "Ce que ce connecteur copie dans le projet.",
|
|
297
353
|
noSyncsTitle: "Aucune synchronisation",
|
|
@@ -321,6 +377,26 @@ export const fr: Translation<DataMessages> = {
|
|
|
321
377
|
connector: "Connecteur",
|
|
322
378
|
dataset: "Jeu de données",
|
|
323
379
|
runWhat: "Les synchronisations",
|
|
380
|
+
accounts: (count: number, formatted: string) =>
|
|
381
|
+
plural("fr", count, { one: `${formatted} compte`, other: `${formatted} comptes` }),
|
|
382
|
+
needReconnecting: (count: number) =>
|
|
383
|
+
plural("fr", count, {
|
|
384
|
+
one: "1 à reconnecter",
|
|
385
|
+
other: `${count} à reconnecter`,
|
|
386
|
+
}),
|
|
387
|
+
failingAccounts: (count: number) =>
|
|
388
|
+
plural("fr", count, { one: "1 en échec", other: `${count} en échec` }),
|
|
389
|
+
project: "Projet",
|
|
390
|
+
slot: (slot: string) => `Emplacement ${slot}`,
|
|
391
|
+
notSyncedYet: "Pas encore synchronisé",
|
|
392
|
+
needsReconnecting: "À reconnecter",
|
|
393
|
+
syncAccount: (account: string) => `Synchroniser ${account}`,
|
|
394
|
+
needsAttention: "À traiter",
|
|
395
|
+
noAccounts: "Aucun compte",
|
|
396
|
+
accountsStat: "Comptes",
|
|
397
|
+
syncedStat: "Synchronisés",
|
|
398
|
+
attentionStat: "À traiter",
|
|
399
|
+
lastSynced: "Dernière synchronisation",
|
|
324
400
|
},
|
|
325
401
|
datasets: {
|
|
326
402
|
title: "Jeux de données",
|
|
@@ -489,6 +565,9 @@ export const fr: Translation<DataMessages> = {
|
|
|
489
565
|
conflict: "En cas de conflit",
|
|
490
566
|
editsWin: "Les modifications faites dans Sixb l’emportent",
|
|
491
567
|
mostRecent: (column: string) => `La ligne la plus récente l’emporte, selon ${column}`,
|
|
568
|
+
missing: "Quand une ligne disparaît",
|
|
569
|
+
missingRemove: "Son objet disparaît, même créé dans Sixb",
|
|
570
|
+
missingKeep: "Les objets créés dans Sixb restent",
|
|
492
571
|
rowsRead: "Lignes lues",
|
|
493
572
|
rowsSkipped: (count: number, formatted: string) =>
|
|
494
573
|
plural("fr", count, { one: `${formatted} ignorée`, other: `${formatted} ignorées` }),
|