@burdenoff/microfe-planmagnet 2026.930.18 → 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/hooks/useLiveRefresh.d.ts.map +1 -1
- package/dist/planmagnet/hooks/useLiveRefresh.js +47 -46
- package/dist/planmagnet/hooks/useLiveRefresh.js.map +1 -1
- 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/DocsDocDetailPagePage.js +1 -1
- 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,71 @@
|
|
|
1
|
+
//#region src/planmagnet/integrations/syncTypes.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"INBOUND",
|
|
4
|
+
"OUTBOUND",
|
|
5
|
+
"BIDIRECTIONAL"
|
|
6
|
+
], t = [
|
|
7
|
+
"IDLE",
|
|
8
|
+
"SYNCING",
|
|
9
|
+
"SUCCESS",
|
|
10
|
+
"FAILED",
|
|
11
|
+
"PAUSED",
|
|
12
|
+
"DISABLED"
|
|
13
|
+
], n = [
|
|
14
|
+
"SOURCE_WINS",
|
|
15
|
+
"TARGET_WINS",
|
|
16
|
+
"MANUAL"
|
|
17
|
+
], r = ["priority", "dueDate"], i = {
|
|
18
|
+
priority: "priority:",
|
|
19
|
+
dueDate: "due:"
|
|
20
|
+
}, a = {
|
|
21
|
+
JIRA: "Jira",
|
|
22
|
+
GITHUB: "GitHub",
|
|
23
|
+
GITLAB: "GitLab",
|
|
24
|
+
AZURE_DEVOPS: "Azure DevOps",
|
|
25
|
+
ASANA: "Asana",
|
|
26
|
+
TRELLO: "Trello",
|
|
27
|
+
LINEAR: "Linear",
|
|
28
|
+
SHORTCUT: "Shortcut",
|
|
29
|
+
CLICKUP: "ClickUp",
|
|
30
|
+
CUSTOM: "Custom"
|
|
31
|
+
};
|
|
32
|
+
function o(e) {
|
|
33
|
+
return a[e] ?? e;
|
|
34
|
+
}
|
|
35
|
+
var s = {
|
|
36
|
+
INBOUND: "Inbound (provider → PlanMagnet)",
|
|
37
|
+
OUTBOUND: "Outbound (PlanMagnet → provider)",
|
|
38
|
+
BIDIRECTIONAL: "Bidirectional (both ways)"
|
|
39
|
+
};
|
|
40
|
+
function c(e) {
|
|
41
|
+
return s[e] ?? e;
|
|
42
|
+
}
|
|
43
|
+
function l(e, t) {
|
|
44
|
+
return t === "INBOUND" ? e.supportsImport : t === "OUTBOUND" ? e.supportsExport : e.supportsBidirectional;
|
|
45
|
+
}
|
|
46
|
+
function u(e) {
|
|
47
|
+
return e.supportsImport || e.supportsExport || e.supportsBidirectional;
|
|
48
|
+
}
|
|
49
|
+
var d = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$/, f = /^[A-Za-z0-9._-]{1,100}$/;
|
|
50
|
+
function p(e) {
|
|
51
|
+
return d.test(e.trim());
|
|
52
|
+
}
|
|
53
|
+
function m(e) {
|
|
54
|
+
return f.test(e.trim());
|
|
55
|
+
}
|
|
56
|
+
function h(e) {
|
|
57
|
+
let t = {
|
|
58
|
+
priority: "",
|
|
59
|
+
dueDate: ""
|
|
60
|
+
};
|
|
61
|
+
if (!e || typeof e != "object" || Array.isArray(e)) return t;
|
|
62
|
+
for (let n of r) {
|
|
63
|
+
let r = e[n];
|
|
64
|
+
typeof r == "string" && r.trim() && (t[n] = r.trim());
|
|
65
|
+
}
|
|
66
|
+
return t;
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export { n as CONFLICT_RESOLUTIONS, i as GITHUB_FIELD_MAPPING_DEFAULTS, e as SYNC_DIRECTIONS, t as SYNC_STATUSES, c as directionLabel, l as directionSupported, p as isValidGithubOwner, m as isValidGithubRepo, h as parseGithubFieldMapping, u as providerIsLive, o as providerLabel };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=syncTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syncTypes.js","names":[],"sources":["../../../src/planmagnet/integrations/syncTypes.ts"],"sourcesContent":["/**\n * Shared shapes and constants for External Sync (AUT-06/08/09/10/20/22/23/24/40) — GraphQL Hive doc comments and\n * `wspace-planmagnet-svc#63` are the source of truth for all of this, not guesswork:\n *\n * - GITHUB is the one provider with a real, live connector today (`github-connector.ts`); every other\n * `PlanmagnetSyncProvider` is accepted by `planmagnetCreateExternalSync` (a customer can configure it ahead of\n * time) but has no live connector, which `planmagnetSupportedSyncProviders` reports honestly (every capability\n * flag false except `supportsFileImport`, which is the unrelated `planmagnetImportExternalIssues` CSV/JSON\n * upload path, not an `ExternalSync` live run). The wizard reads that capability list rather than hard-coding\n * \"GitHub only\" — if a second connector ships, this UI lights up for it automatically.\n * - `ExternalSync.connectionConfig` for GITHUB is `{ token, owner, repo }` and is REDACTED server-side on every\n * read (`token` -> `[REDACTED]`; `owner`/`repo` are not secret and pass through). It must never be displayed as\n * if it still held the token, and never round-tripped back to the server as if `[REDACTED]` were a real value.\n * - `ExternalSync.fieldMapping` for GITHUB is exactly two optional label-prefix strings —\n * `{ priority?: string; dueDate?: string }` (default `\"priority:\"` / `\"due:\"`) — because GitHub Issues have no\n * native priority or due-date column; the connector encodes/decodes them as a label of the form\n * `{prefix}{value}` (e.g. `priority:HIGH`, `due:2026-10-01`). This is the only field-mapping shape the live\n * connector reads; it is NOT the (unrelated) CSV/JSON import's column-name mapping.\n * - `PlanmagnetUpdateExternalSyncInput.connectionConfig` REPLACES the whole stored config — it does not merge —\n * so an edit that changes only the token must resend `owner`/`repo` too (read back from the redacted\n * `connectionConfig`, which is safe since only `token` is masked), and an edit that changes owner/repo without a\n * new token cannot be sent at all (the real token can never be read back to resend it). See\n * `controls/SyncControls.tsx`'s `EditSyncConnectionDialog`.\n */\n\nexport const SYNC_PROVIDERS = [\n 'JIRA',\n 'GITHUB',\n 'GITLAB',\n 'AZURE_DEVOPS',\n 'ASANA',\n 'TRELLO',\n 'LINEAR',\n 'SHORTCUT',\n 'CLICKUP',\n 'CUSTOM',\n] as const;\nexport type SyncProvider = (typeof SYNC_PROVIDERS)[number];\n\nexport const SYNC_DIRECTIONS = ['INBOUND', 'OUTBOUND', 'BIDIRECTIONAL'] as const;\nexport type SyncDirection = (typeof SYNC_DIRECTIONS)[number];\n\nexport const SYNC_STATUSES = [\n 'IDLE',\n 'SYNCING',\n 'SUCCESS',\n 'FAILED',\n 'PAUSED',\n 'DISABLED',\n] as const;\nexport type SyncStatus = (typeof SYNC_STATUSES)[number];\n\nexport const CONFLICT_RESOLUTIONS = ['SOURCE_WINS', 'TARGET_WINS', 'MANUAL'] as const;\nexport type ConflictResolution = (typeof CONFLICT_RESOLUTIONS)[number];\n\nexport const CONFLICT_STATUSES = ['OPEN', 'RESOLVED'] as const;\nexport type ConflictStatus = (typeof CONFLICT_STATUSES)[number];\n\nexport const SYNC_RUN_STATUSES = ['SUCCEEDED', 'FAILED', 'PARTIAL'] as const;\nexport type SyncRunStatus = (typeof SYNC_RUN_STATUSES)[number];\n\n/** The two GitHub label-prefix keys `ExternalSync.fieldMapping` actually understands (github-connector.ts). */\nexport const GITHUB_FIELD_MAPPING_KEYS = ['priority', 'dueDate'] as const;\nexport type GithubFieldMappingKey = (typeof GITHUB_FIELD_MAPPING_KEYS)[number];\n/** The connector's own built-in defaults, used only as placeholder copy — never assumed server-side. */\nexport const GITHUB_FIELD_MAPPING_DEFAULTS: Record<GithubFieldMappingKey, string> = {\n priority: 'priority:',\n dueDate: 'due:',\n};\n\nexport interface ProjectRef {\n id: string;\n name: string;\n}\n\nexport interface RunHealth {\n lastRunAt: string | null;\n lastStatus: SyncRunStatus | null;\n consecutiveFailures: number;\n runsLast7Days: number;\n}\n\nexport interface ExternalSyncRow {\n id: string;\n provider: SyncProvider;\n direction: SyncDirection;\n status: SyncStatus;\n projectId: string;\n project: ProjectRef | null;\n externalProjectId: string;\n externalProjectUrl: string | null;\n conflictStrategy: ConflictResolution;\n fieldMapping: unknown;\n /** Stored but not yet read by any run (sync.service.ts) — surfaced honestly in the edit form, not hidden. */\n syncFilters: unknown;\n lastSyncedAt: string | null;\n lastSyncError: string | null;\n totalItemsSynced: number;\n createdAt: string;\n updatedAt: string;\n runHealth: RunHealth;\n}\n\nexport interface SyncProviderCapability {\n provider: SyncProvider;\n supportsImport: boolean;\n supportsExport: boolean;\n supportsBidirectional: boolean;\n supportsFileImport: boolean;\n supportsConnectionTest: boolean;\n}\n\nexport interface SyncRunRow {\n id: string;\n direction: SyncDirection;\n status: SyncRunStatus;\n startedAt: string;\n finishedAt: string;\n itemsCreated: number;\n itemsUpdated: number;\n itemsSkipped: number;\n errorCount: number;\n conflictCount: number;\n errorMessage: string | null;\n triggeredBy: string;\n}\n\nexport interface ExternalMappingRef {\n id: string;\n internalId: string;\n internalType: string;\n externalId: string;\n externalType: string;\n externalUrl: string | null;\n}\n\nexport interface SyncConflictRow {\n id: string;\n createdAt: string;\n fields: string[];\n localUpdatedAt: string;\n remoteUpdatedAt: string;\n resolution: ConflictResolution | null;\n resolvedAt: string | null;\n resolvedBy: string | null;\n status: ConflictStatus;\n mapping: ExternalMappingRef | null;\n mappingId: string;\n}\n\n/** `PlanmagnetSyncResult` — what `planmagnetStartSync` returns. */\nexport interface SyncRunResult {\n syncId: string;\n success: boolean;\n itemsCreated: number;\n itemsUpdated: number;\n itemsSkipped: number;\n errorCount: number;\n errors: string[] | null;\n conflictCount: number;\n durationMs: number | null;\n syncedAt: string;\n}\n\n/** `PlanmagnetSyncConnectionTestResult` — what `planmagnetTestExternalSync` returns. */\nexport interface SyncConnectionTestResult {\n ok: boolean;\n message: string;\n rateLimitRemaining: number | null;\n}\n\nconst PROVIDER_LABELS: Record<SyncProvider, string> = {\n JIRA: 'Jira',\n GITHUB: 'GitHub',\n GITLAB: 'GitLab',\n AZURE_DEVOPS: 'Azure DevOps',\n ASANA: 'Asana',\n TRELLO: 'Trello',\n LINEAR: 'Linear',\n SHORTCUT: 'Shortcut',\n CLICKUP: 'ClickUp',\n CUSTOM: 'Custom',\n};\n\nexport function providerLabel(provider: string): string {\n return PROVIDER_LABELS[provider as SyncProvider] ?? provider;\n}\n\nconst DIRECTION_LABELS: Record<SyncDirection, string> = {\n INBOUND: 'Inbound (provider → PlanMagnet)',\n OUTBOUND: 'Outbound (PlanMagnet → provider)',\n BIDIRECTIONAL: 'Bidirectional (both ways)',\n};\n\nexport function directionLabel(direction: string): string {\n return DIRECTION_LABELS[direction as SyncDirection] ?? direction;\n}\n\n/** Whether a capability supports a given direction at all — the single gate the wizard and the edit form both use. */\nexport function directionSupported(\n capability: Pick<\n SyncProviderCapability,\n 'supportsImport' | 'supportsExport' | 'supportsBidirectional'\n >,\n direction: SyncDirection\n): boolean {\n if (direction === 'INBOUND') return capability.supportsImport;\n if (direction === 'OUTBOUND') return capability.supportsExport;\n return capability.supportsBidirectional;\n}\n\n/** True once a provider can run at least one live direction — the gate for selecting it in the wizard at all. */\nexport function providerIsLive(\n capability: Pick<\n SyncProviderCapability,\n 'supportsImport' | 'supportsExport' | 'supportsBidirectional'\n >\n): boolean {\n return capability.supportsImport || capability.supportsExport || capability.supportsBidirectional;\n}\n\n/**\n * `ExternalSync.fieldMapping` -> the two GitHub label prefixes, as blank strings when unset (meaning \"the\n * connector's built-in default applies\"), never pre-filled with that default text — so an untouched form saves\n * nothing and a save always reflects a real, deliberate choice.\n */\n/** GitHub org/user name rules: 1-39 chars, alphanumeric or single hyphens, no leading/trailing hyphen. */\nconst GITHUB_OWNER_RE = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$/;\n/** GitHub repo name rules: 1-100 chars of letters, digits, `.`, `-`, `_`. */\nconst GITHUB_REPO_RE = /^[A-Za-z0-9._-]{1,100}$/;\n\nexport function isValidGithubOwner(value: string): boolean {\n return GITHUB_OWNER_RE.test(value.trim());\n}\nexport function isValidGithubRepo(value: string): boolean {\n return GITHUB_REPO_RE.test(value.trim());\n}\n\nexport function parseGithubFieldMapping(value: unknown): Record<GithubFieldMappingKey, string> {\n const out: Record<GithubFieldMappingKey, string> = { priority: '', dueDate: '' };\n if (!value || typeof value !== 'object' || Array.isArray(value)) return out;\n for (const key of GITHUB_FIELD_MAPPING_KEYS) {\n const raw = (value as Record<string, unknown>)[key];\n if (typeof raw === 'string' && raw.trim()) out[key] = raw.trim();\n }\n return out;\n}\n"],"mappings":";AAuCA,IAAa,IAAkB;CAAC;CAAW;CAAY;CAAgB,EAG1D,IAAgB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACD,EAGY,IAAuB;CAAC;CAAe;CAAe;CAAS,EAU/D,IAA4B,CAAC,YAAY,UAAU,EAGnD,IAAuE;CAClF,UAAU;CACV,SAAS;CACV,EAuGK,IAAgD;CACpD,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,cAAc;CACd,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,SAAS;CACT,QAAQ;CACT;AAED,SAAgB,EAAc,GAA0B;AACtD,QAAO,EAAgB,MAA6B;;AAGtD,IAAM,IAAkD;CACtD,SAAS;CACT,UAAU;CACV,eAAe;CAChB;AAED,SAAgB,EAAe,GAA2B;AACxD,QAAO,EAAiB,MAA+B;;AAIzD,SAAgB,EACd,GAIA,GACS;AAGT,QAFI,MAAc,YAAkB,EAAW,iBAC3C,MAAc,aAAmB,EAAW,iBACzC,EAAW;;AAIpB,SAAgB,EACd,GAIS;AACT,QAAO,EAAW,kBAAkB,EAAW,kBAAkB,EAAW;;AAS9E,IAAM,IAAkB,mDAElB,IAAiB;AAEvB,SAAgB,EAAmB,GAAwB;AACzD,QAAO,EAAgB,KAAK,EAAM,MAAM,CAAC;;AAE3C,SAAgB,EAAkB,GAAwB;AACxD,QAAO,EAAe,KAAK,EAAM,MAAM,CAAC;;AAG1C,SAAgB,EAAwB,GAAuD;CAC7F,IAAM,IAA6C;EAAE,UAAU;EAAI,SAAS;EAAI;AAChF,KAAI,CAAC,KAAS,OAAO,KAAU,YAAY,MAAM,QAAQ,EAAM,CAAE,QAAO;AACxE,MAAK,IAAM,KAAO,GAA2B;EAC3C,IAAM,IAAO,EAAkC;AAC/C,EAAI,OAAO,KAAQ,YAAY,EAAI,MAAM,KAAE,EAAI,KAAO,EAAI,MAAM;;AAElE,QAAO"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SyncProviderCapability } from './syncTypes';
|
|
2
|
+
|
|
3
|
+
export declare function useSyncProviderCapabilities(): {
|
|
4
|
+
capabilities: SyncProviderCapability[];
|
|
5
|
+
loading: boolean;
|
|
6
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=useSyncProviderCapabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSyncProviderCapabilities.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/integrations/useSyncProviderCapabilities.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAqB1D,wBAAgB,2BAA2B;;;;EAW1C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { gql as e } from "@apollo/client";
|
|
2
|
+
import { useQuery as t } from "@apollo/client/react";
|
|
3
|
+
//#region src/planmagnet/integrations/useSyncProviderCapabilities.ts
|
|
4
|
+
var n = e`
|
|
5
|
+
query SupportedSyncProviders {
|
|
6
|
+
planmagnetSupportedSyncProviders {
|
|
7
|
+
provider
|
|
8
|
+
supportsImport
|
|
9
|
+
supportsExport
|
|
10
|
+
supportsBidirectional
|
|
11
|
+
supportsFileImport
|
|
12
|
+
supportsConnectionTest
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
function r() {
|
|
17
|
+
let { data: e, loading: r, error: i } = t(n);
|
|
18
|
+
return {
|
|
19
|
+
capabilities: e?.planmagnetSupportedSyncProviders ?? [],
|
|
20
|
+
loading: r && !e,
|
|
21
|
+
error: i
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { r as useSyncProviderCapabilities };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=useSyncProviderCapabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSyncProviderCapabilities.js","names":[],"sources":["../../../src/planmagnet/integrations/useSyncProviderCapabilities.ts"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport type { SyncProviderCapability } from './syncTypes';\n\n/**\n * AUT-23/20 — `planmagnetSupportedSyncProviders`: one provider's real capabilities, derived server-side from the\n * connector code itself (`SYNC_PROVIDER_CAPABILITIES` in sync.service.ts), never a hard-coded wish list here.\n * Drives which providers the setup wizard can select, which directions each one offers, and whether \"Test\n * connection\" has anything real to call.\n */\nconst SUPPORTED_SYNC_PROVIDERS = gql`\n query SupportedSyncProviders {\n planmagnetSupportedSyncProviders {\n provider\n supportsImport\n supportsExport\n supportsBidirectional\n supportsFileImport\n supportsConnectionTest\n }\n }\n`;\n\nexport function useSyncProviderCapabilities() {\n const { data, loading, error } = useQuery<{\n planmagnetSupportedSyncProviders: SyncProviderCapability[];\n }>(SUPPORTED_SYNC_PROVIDERS);\n\n return {\n capabilities: data?.planmagnetSupportedSyncProviders ?? [],\n // Only before the first load: a refetch must not read as \"nothing is supported\".\n loading: loading && !data,\n error,\n };\n}\n"],"mappings":";;;AAUA,IAAM,IAA2B,CAAG;;;;;;;;;;;;AAapC,SAAgB,IAA8B;CAC5C,IAAM,EAAE,SAAM,YAAS,aAAU,EAE9B,EAAyB;AAE5B,QAAO;EACL,cAAc,GAAM,oCAAoC,EAAE;EAE1D,SAAS,KAAW,CAAC;EACrB;EACD"}
|
|
@@ -12,8 +12,8 @@ import { gql as a } from "@apollo/client";
|
|
|
12
12
|
import { useApolloClient as ue, useMutation as o, useQuery as de } from "@apollo/client/react";
|
|
13
13
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
14
14
|
import { AlertDialog as l, AlertDialogAction as u, AlertDialogCancel as d, AlertDialogContent as f, AlertDialogDescription as p, AlertDialogFooter as m, AlertDialogHeader as h, AlertDialogTitle as g, AlertDialogTrigger as _, Button as v, Card as y, CardContent as b, CardHeader as x, CardTitle as S, Input as C } from "@burdenoff/fe-libs/ui";
|
|
15
|
-
import { Markdown as w } from "@burdenoff/fe-libs/shared/components";
|
|
16
15
|
import { clearGraphqlFetchResponseCache as fe } from "@burdenoff/fe-libs/shared/graphql";
|
|
16
|
+
import { Markdown as w } from "@burdenoff/fe-libs/shared/components";
|
|
17
17
|
//#region src/planmagnet/pages/DocsDocDetailPagePage.tsx
|
|
18
18
|
var T = a`
|
|
19
19
|
query DocDetail($id: ID!) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntegrationsNewSyncPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/IntegrationsNewSyncPagePage.tsx"],"names":[],"mappings":"AA0IA,wBAAgB,2BAA2B,4CAqY1C"}
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import { usePlanMagnetNavigate as e } from "../providers/PlanMagnetProvider.js";
|
|
2
|
+
import { throwOnError as t } from "../utils/mutationResult.js";
|
|
3
|
+
import { ErrorLine as n } from "../controls/ConfirmButton.js";
|
|
4
|
+
import { enumLabel as r } from "../controls/WorkItemControls.js";
|
|
5
|
+
import { ProjectSelect as i } from "../controls/Pickers.js";
|
|
6
|
+
import { detailPath as a } from "../utils/rowNavigation.js";
|
|
7
|
+
import { isForbidden as ee, mutationErrorMessage as te } from "../utils/graphqlErrors.js";
|
|
8
|
+
import { useSyncProviderCapabilities as o } from "../integrations/useSyncProviderCapabilities.js";
|
|
9
|
+
import { CONFLICT_RESOLUTIONS as s, GITHUB_FIELD_MAPPING_DEFAULTS as c, SYNC_DIRECTIONS as ne, directionLabel as l, directionSupported as re, isValidGithubOwner as ie, isValidGithubRepo as ae, providerIsLive as u, providerLabel as d } from "../integrations/syncTypes.js";
|
|
10
|
+
import { CONFLICT_STRATEGY_EXPLANATION as oe, RunNowButton as se, SyncRunResultSummary as ce, TestConnectionButton as f } from "../controls/SyncControls.js";
|
|
11
|
+
import { useState as p } from "react";
|
|
12
|
+
import { ArrowLeft as le, CheckCircle2 as ue, Github as m, Loader2 as de, Plug as h, ShieldQuestion as fe } from "lucide-react";
|
|
13
|
+
import { gql as g } from "@apollo/client";
|
|
14
|
+
import { useMutation as pe } from "@apollo/client/react";
|
|
15
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
16
|
+
import { Button as b, Card as x, CardContent as S, CardHeader as C, CardTitle as w, Checkbox as me, Input as T } from "@burdenoff/fe-libs/ui";
|
|
17
|
+
//#region src/planmagnet/pages/IntegrationsNewSyncPagePage.tsx
|
|
18
|
+
var E = "text-sm font-medium", he = g`
|
|
19
|
+
mutation NewSyncCreate($input: PlanmagnetCreateExternalSyncInput!) {
|
|
20
|
+
planmagnetCreateExternalSync(input: $input) {
|
|
21
|
+
id
|
|
22
|
+
provider
|
|
23
|
+
status
|
|
24
|
+
project {
|
|
25
|
+
id
|
|
26
|
+
name
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
function ge({ capabilities: e, capabilitiesLoading: t, provider: n, onSelect: r }) {
|
|
32
|
+
return /* @__PURE__ */ y(x, {
|
|
33
|
+
"data-testid": "sync-wizard-step",
|
|
34
|
+
children: [/* @__PURE__ */ v(C, { children: /* @__PURE__ */ v(w, { children: "1. Provider" }) }), /* @__PURE__ */ y(S, {
|
|
35
|
+
className: "space-y-2",
|
|
36
|
+
children: [t && /* @__PURE__ */ v("p", {
|
|
37
|
+
className: "text-sm text-muted-foreground",
|
|
38
|
+
children: "Loading providers…"
|
|
39
|
+
}), /* @__PURE__ */ v("div", {
|
|
40
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-2",
|
|
41
|
+
children: e.map((e) => {
|
|
42
|
+
let t = u(e), i = n === e.provider;
|
|
43
|
+
return /* @__PURE__ */ y("button", {
|
|
44
|
+
type: "button",
|
|
45
|
+
disabled: !t,
|
|
46
|
+
"aria-pressed": i,
|
|
47
|
+
"data-testid": `sync-wizard-provider-${e.provider}`,
|
|
48
|
+
onClick: () => t && r(e.provider),
|
|
49
|
+
className: `flex items-start gap-2 rounded-md border p-3 text-left text-sm transition-colors ${i ? "border-primary bg-primary/5" : "border-input"} ${t ? "hover:bg-muted" : "cursor-not-allowed opacity-50"}`,
|
|
50
|
+
children: [e.provider === "GITHUB" ? /* @__PURE__ */ v(m, { className: "mt-0.5 h-4 w-4 shrink-0" }) : /* @__PURE__ */ v(h, { className: "mt-0.5 h-4 w-4 shrink-0" }), /* @__PURE__ */ y("span", { children: [/* @__PURE__ */ v("span", {
|
|
51
|
+
className: "block font-medium",
|
|
52
|
+
children: d(e.provider)
|
|
53
|
+
}), /* @__PURE__ */ v("span", {
|
|
54
|
+
className: "block text-xs text-muted-foreground",
|
|
55
|
+
children: t ? [
|
|
56
|
+
e.supportsImport && "inbound",
|
|
57
|
+
e.supportsExport && "outbound",
|
|
58
|
+
e.supportsBidirectional && "bidirectional"
|
|
59
|
+
].filter(Boolean).join(", ") + " sync" : "No live connector yet — inbound, outbound and bidirectional sync are all unavailable for this provider."
|
|
60
|
+
})] })]
|
|
61
|
+
}, e.provider);
|
|
62
|
+
})
|
|
63
|
+
})]
|
|
64
|
+
})]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function D() {
|
|
68
|
+
let u = e(), { capabilities: m, loading: h } = o(), [g, D] = p(""), [O, _e] = p(""), [k, A] = p(""), [j, M] = p(""), [N, P] = p(""), [F, I] = p(""), [L, ve] = p("MANUAL"), [R, ye] = p(""), [z, be] = p(""), [B, xe] = p(!0), [V, H] = p(null), [U, Se] = p(null), [W, Ce] = p(null), [G, K] = pe(he, { refetchQueries: ["SyncsList"] }), q = m.find((e) => e.provider === g), J = g === "GITHUB", Y = q ? ne.filter((e) => re(q, e)) : [], X = k.trim() !== "" && ie(k), Z = j.trim() !== "" && ae(j), Q = !!g && !!O && (!J || X && Z) && !!N, $ = Q && F.trim() !== "", we = () => {
|
|
69
|
+
let e = {};
|
|
70
|
+
return R.trim() && (e.priority = R.trim()), z.trim() && (e.dueDate = z.trim()), {
|
|
71
|
+
projectId: O,
|
|
72
|
+
provider: g,
|
|
73
|
+
direction: N,
|
|
74
|
+
externalProjectId: J ? `${k.trim()}/${j.trim()}` : "",
|
|
75
|
+
externalProjectUrl: J ? `https://github.com/${k.trim()}/${j.trim()}` : void 0,
|
|
76
|
+
connectionConfig: J ? {
|
|
77
|
+
token: F.trim(),
|
|
78
|
+
owner: k.trim(),
|
|
79
|
+
repo: j.trim()
|
|
80
|
+
} : {},
|
|
81
|
+
conflictStrategy: L,
|
|
82
|
+
...Object.keys(e).length > 0 ? { fieldMapping: e } : {},
|
|
83
|
+
testConnection: B
|
|
84
|
+
};
|
|
85
|
+
}, Te = async () => {
|
|
86
|
+
if (H(null), !$) {
|
|
87
|
+
H("Fill in the project, external project and credentials above before creating the sync.");
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
let e = await t(G({ variables: { input: we() } }));
|
|
92
|
+
e.data && Se(e.data.planmagnetCreateExternalSync);
|
|
93
|
+
} catch (e) {
|
|
94
|
+
H(ee(e) ? "Your role can view integrations but not set them up." : te(e, "The sync could not be created."));
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
return U ? /* @__PURE__ */ v("div", {
|
|
98
|
+
className: "space-y-6 p-6 max-w-2xl",
|
|
99
|
+
children: /* @__PURE__ */ y(x, {
|
|
100
|
+
"data-testid": "sync-wizard-created",
|
|
101
|
+
children: [/* @__PURE__ */ v(C, { children: /* @__PURE__ */ y(w, {
|
|
102
|
+
className: "flex items-center gap-2",
|
|
103
|
+
children: [/* @__PURE__ */ v(ue, { className: "h-5 w-5 text-status-success-text" }), "Sync created"]
|
|
104
|
+
}) }), /* @__PURE__ */ y(S, {
|
|
105
|
+
className: "space-y-4",
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ y("p", {
|
|
108
|
+
className: "text-sm text-muted-foreground",
|
|
109
|
+
children: [
|
|
110
|
+
d(U.provider),
|
|
111
|
+
" sync for ",
|
|
112
|
+
U.project?.name ?? "the project",
|
|
113
|
+
" is set up and idle. Test the connection and run the first sync now, or do either later from the sync's own page."
|
|
114
|
+
]
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ y("div", {
|
|
117
|
+
className: "flex flex-wrap items-center gap-3",
|
|
118
|
+
children: [/* @__PURE__ */ v(f, { syncId: U.id }), /* @__PURE__ */ v(se, {
|
|
119
|
+
syncId: U.id,
|
|
120
|
+
onResult: Ce
|
|
121
|
+
})]
|
|
122
|
+
}),
|
|
123
|
+
W && /* @__PURE__ */ v(ce, { result: W }),
|
|
124
|
+
/* @__PURE__ */ v(b, {
|
|
125
|
+
onClick: () => u(a("/integrations/sync-detail-page", U.id)),
|
|
126
|
+
"data-testid": "sync-wizard-view",
|
|
127
|
+
children: "View sync"
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
})]
|
|
131
|
+
})
|
|
132
|
+
}) : /* @__PURE__ */ y("div", {
|
|
133
|
+
className: "space-y-6 p-6 max-w-2xl",
|
|
134
|
+
children: [
|
|
135
|
+
/* @__PURE__ */ y("div", {
|
|
136
|
+
className: "flex items-start gap-3",
|
|
137
|
+
children: [/* @__PURE__ */ v(b, {
|
|
138
|
+
variant: "ghost",
|
|
139
|
+
size: "icon",
|
|
140
|
+
"aria-label": "Back to Integrations",
|
|
141
|
+
onClick: () => u("/integrations/syncs-page"),
|
|
142
|
+
children: /* @__PURE__ */ v(le, { className: "h-4 w-4" })
|
|
143
|
+
}), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h1", {
|
|
144
|
+
className: "text-2xl font-semibold",
|
|
145
|
+
children: "Set up a sync"
|
|
146
|
+
}), /* @__PURE__ */ v("p", {
|
|
147
|
+
className: "text-sm text-muted-foreground",
|
|
148
|
+
children: "Connect a PlanMagnet project to an external issue tracker so work items stay in step on both sides."
|
|
149
|
+
})] })]
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ v(ge, {
|
|
152
|
+
capabilities: m,
|
|
153
|
+
capabilitiesLoading: h,
|
|
154
|
+
provider: g,
|
|
155
|
+
onSelect: (e) => {
|
|
156
|
+
D(e), P(""), A(""), M(""), I("");
|
|
157
|
+
}
|
|
158
|
+
}),
|
|
159
|
+
g && /* @__PURE__ */ y(x, {
|
|
160
|
+
"data-testid": "sync-wizard-step",
|
|
161
|
+
children: [/* @__PURE__ */ v(C, { children: /* @__PURE__ */ v(w, { children: "2. Project, external project and direction" }) }), /* @__PURE__ */ y(S, {
|
|
162
|
+
className: "space-y-4",
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
165
|
+
htmlFor: "sync-wizard-project",
|
|
166
|
+
className: E,
|
|
167
|
+
children: "PlanMagnet project"
|
|
168
|
+
}), /* @__PURE__ */ v("div", {
|
|
169
|
+
className: "mt-1",
|
|
170
|
+
children: /* @__PURE__ */ v(i, {
|
|
171
|
+
id: "sync-wizard-project",
|
|
172
|
+
value: O,
|
|
173
|
+
noneLabel: "Choose a project",
|
|
174
|
+
onChange: _e
|
|
175
|
+
})
|
|
176
|
+
})] }),
|
|
177
|
+
J && /* @__PURE__ */ y("div", {
|
|
178
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
|
|
179
|
+
children: [/* @__PURE__ */ y("div", { children: [
|
|
180
|
+
/* @__PURE__ */ v("label", {
|
|
181
|
+
htmlFor: "sync-wizard-owner",
|
|
182
|
+
className: E,
|
|
183
|
+
children: "GitHub owner (user or org)"
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ v(T, {
|
|
186
|
+
id: "sync-wizard-owner",
|
|
187
|
+
className: "mt-1",
|
|
188
|
+
placeholder: "e.g. algoshred",
|
|
189
|
+
value: k,
|
|
190
|
+
"data-testid": "sync-wizard-owner",
|
|
191
|
+
onChange: (e) => A(e.target.value)
|
|
192
|
+
}),
|
|
193
|
+
k.trim() !== "" && !X && /* @__PURE__ */ v(n, { message: "Not a valid GitHub owner name." })
|
|
194
|
+
] }), /* @__PURE__ */ y("div", { children: [
|
|
195
|
+
/* @__PURE__ */ v("label", {
|
|
196
|
+
htmlFor: "sync-wizard-repo",
|
|
197
|
+
className: E,
|
|
198
|
+
children: "Repository"
|
|
199
|
+
}),
|
|
200
|
+
/* @__PURE__ */ v(T, {
|
|
201
|
+
id: "sync-wizard-repo",
|
|
202
|
+
className: "mt-1",
|
|
203
|
+
placeholder: "e.g. wspace-planmagnet-svc",
|
|
204
|
+
value: j,
|
|
205
|
+
"data-testid": "sync-wizard-repo",
|
|
206
|
+
onChange: (e) => M(e.target.value)
|
|
207
|
+
}),
|
|
208
|
+
j.trim() !== "" && !Z && /* @__PURE__ */ v(n, { message: "Not a valid repository name." })
|
|
209
|
+
] })]
|
|
210
|
+
}),
|
|
211
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("span", {
|
|
212
|
+
className: E,
|
|
213
|
+
children: "Direction"
|
|
214
|
+
}), Y.length === 0 ? /* @__PURE__ */ v("p", {
|
|
215
|
+
className: "mt-1 text-sm text-muted-foreground",
|
|
216
|
+
children: "This provider offers no live sync direction yet."
|
|
217
|
+
}) : /* @__PURE__ */ v("div", {
|
|
218
|
+
className: "mt-1 flex flex-col gap-1",
|
|
219
|
+
role: "radiogroup",
|
|
220
|
+
"aria-label": "Direction",
|
|
221
|
+
children: Y.map((e) => /* @__PURE__ */ y("label", {
|
|
222
|
+
className: "flex items-center gap-2 text-sm",
|
|
223
|
+
children: [/* @__PURE__ */ v("input", {
|
|
224
|
+
type: "radio",
|
|
225
|
+
name: "sync-wizard-direction",
|
|
226
|
+
checked: N === e,
|
|
227
|
+
"data-testid": `sync-wizard-direction-${e}`,
|
|
228
|
+
onChange: () => P(e)
|
|
229
|
+
}), l(e)]
|
|
230
|
+
}, e))
|
|
231
|
+
})] })
|
|
232
|
+
]
|
|
233
|
+
})]
|
|
234
|
+
}),
|
|
235
|
+
Q && /* @__PURE__ */ y(x, {
|
|
236
|
+
"data-testid": "sync-wizard-step",
|
|
237
|
+
children: [/* @__PURE__ */ v(C, { children: /* @__PURE__ */ v(w, { children: "3. Credentials" }) }), /* @__PURE__ */ v(S, {
|
|
238
|
+
className: "space-y-3",
|
|
239
|
+
children: J && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ y("p", {
|
|
240
|
+
className: "text-sm text-muted-foreground",
|
|
241
|
+
children: [
|
|
242
|
+
"Use a GitHub fine-grained personal access token scoped to",
|
|
243
|
+
" ",
|
|
244
|
+
/* @__PURE__ */ y("strong", { children: [
|
|
245
|
+
k,
|
|
246
|
+
"/",
|
|
247
|
+
j
|
|
248
|
+
] }),
|
|
249
|
+
", with Issues set to ",
|
|
250
|
+
/* @__PURE__ */ v("strong", { children: "Read and write" }),
|
|
251
|
+
" — no other repository permission is needed."
|
|
252
|
+
]
|
|
253
|
+
}), /* @__PURE__ */ y("div", {
|
|
254
|
+
className: "max-w-sm",
|
|
255
|
+
children: [/* @__PURE__ */ v("label", {
|
|
256
|
+
htmlFor: "sync-wizard-token",
|
|
257
|
+
className: E,
|
|
258
|
+
children: "Personal access token"
|
|
259
|
+
}), /* @__PURE__ */ v(T, {
|
|
260
|
+
id: "sync-wizard-token",
|
|
261
|
+
type: "password",
|
|
262
|
+
autoComplete: "off",
|
|
263
|
+
className: "mt-1",
|
|
264
|
+
value: F,
|
|
265
|
+
"data-testid": "sync-wizard-token",
|
|
266
|
+
onChange: (e) => I(e.target.value)
|
|
267
|
+
})]
|
|
268
|
+
})] })
|
|
269
|
+
})]
|
|
270
|
+
}),
|
|
271
|
+
$ && /* @__PURE__ */ y(_, { children: [
|
|
272
|
+
/* @__PURE__ */ y(x, {
|
|
273
|
+
"data-testid": "sync-wizard-step",
|
|
274
|
+
children: [/* @__PURE__ */ v(C, { children: /* @__PURE__ */ v(w, { children: "4. Conflict strategy" }) }), /* @__PURE__ */ y(S, {
|
|
275
|
+
className: "space-y-2",
|
|
276
|
+
children: [/* @__PURE__ */ v("p", {
|
|
277
|
+
className: "text-sm text-muted-foreground",
|
|
278
|
+
children: "What happens when the same item changed on both sides since the last sync."
|
|
279
|
+
}), /* @__PURE__ */ v("div", {
|
|
280
|
+
className: "flex flex-col gap-1",
|
|
281
|
+
role: "radiogroup",
|
|
282
|
+
"aria-label": "Conflict strategy",
|
|
283
|
+
children: s.map((e) => /* @__PURE__ */ y("label", {
|
|
284
|
+
className: "flex items-start gap-2 text-sm",
|
|
285
|
+
children: [/* @__PURE__ */ v("input", {
|
|
286
|
+
type: "radio",
|
|
287
|
+
name: "sync-wizard-strategy",
|
|
288
|
+
className: "mt-0.5",
|
|
289
|
+
checked: L === e,
|
|
290
|
+
"data-testid": `sync-wizard-strategy-${e}`,
|
|
291
|
+
onChange: () => ve(e)
|
|
292
|
+
}), /* @__PURE__ */ y("span", { children: [/* @__PURE__ */ v("span", {
|
|
293
|
+
className: "font-medium",
|
|
294
|
+
children: r(e)
|
|
295
|
+
}), /* @__PURE__ */ v("span", {
|
|
296
|
+
className: "block text-xs text-muted-foreground",
|
|
297
|
+
children: oe[e]
|
|
298
|
+
})] })]
|
|
299
|
+
}, e))
|
|
300
|
+
})]
|
|
301
|
+
})]
|
|
302
|
+
}),
|
|
303
|
+
J && /* @__PURE__ */ y(x, {
|
|
304
|
+
"data-testid": "sync-wizard-step",
|
|
305
|
+
children: [/* @__PURE__ */ v(C, { children: /* @__PURE__ */ v(w, { children: "5. Field mapping (optional)" }) }), /* @__PURE__ */ y(S, {
|
|
306
|
+
className: "space-y-3",
|
|
307
|
+
children: [/* @__PURE__ */ y("p", {
|
|
308
|
+
className: "text-sm text-muted-foreground",
|
|
309
|
+
children: [
|
|
310
|
+
"GitHub issues have no native priority or due-date field — PlanMagnet encodes each as a label of the form ",
|
|
311
|
+
/* @__PURE__ */ v("code", { children: "prefix+value" }),
|
|
312
|
+
" (e.g. ",
|
|
313
|
+
/* @__PURE__ */ v("code", { children: "priority:HIGH" }),
|
|
314
|
+
",",
|
|
315
|
+
" ",
|
|
316
|
+
/* @__PURE__ */ v("code", { children: "due:2026-10-01" }),
|
|
317
|
+
"). Leave both blank to use the built-in prefixes."
|
|
318
|
+
]
|
|
319
|
+
}), /* @__PURE__ */ y("div", {
|
|
320
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
|
|
321
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
|
|
322
|
+
htmlFor: "sync-wizard-priority-prefix",
|
|
323
|
+
className: "text-xs text-muted-foreground",
|
|
324
|
+
children: [
|
|
325
|
+
"Priority label prefix (default \"",
|
|
326
|
+
c.priority,
|
|
327
|
+
"\")"
|
|
328
|
+
]
|
|
329
|
+
}), /* @__PURE__ */ v(T, {
|
|
330
|
+
id: "sync-wizard-priority-prefix",
|
|
331
|
+
className: "mt-1",
|
|
332
|
+
placeholder: c.priority,
|
|
333
|
+
value: R,
|
|
334
|
+
onChange: (e) => ye(e.target.value)
|
|
335
|
+
})] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
|
|
336
|
+
htmlFor: "sync-wizard-duedate-prefix",
|
|
337
|
+
className: "text-xs text-muted-foreground",
|
|
338
|
+
children: [
|
|
339
|
+
"Due-date label prefix (default \"",
|
|
340
|
+
c.dueDate,
|
|
341
|
+
"\")"
|
|
342
|
+
]
|
|
343
|
+
}), /* @__PURE__ */ v(T, {
|
|
344
|
+
id: "sync-wizard-duedate-prefix",
|
|
345
|
+
className: "mt-1",
|
|
346
|
+
placeholder: c.dueDate,
|
|
347
|
+
value: z,
|
|
348
|
+
onChange: (e) => be(e.target.value)
|
|
349
|
+
})] })]
|
|
350
|
+
})]
|
|
351
|
+
})]
|
|
352
|
+
}),
|
|
353
|
+
/* @__PURE__ */ y(x, {
|
|
354
|
+
"data-testid": "sync-wizard-step",
|
|
355
|
+
children: [/* @__PURE__ */ v(C, { children: /* @__PURE__ */ v(w, { children: "6. Review & create" }) }), /* @__PURE__ */ y(S, {
|
|
356
|
+
className: "space-y-3",
|
|
357
|
+
children: [
|
|
358
|
+
/* @__PURE__ */ y("dl", {
|
|
359
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-1 text-sm",
|
|
360
|
+
children: [
|
|
361
|
+
/* @__PURE__ */ v("dt", {
|
|
362
|
+
className: "text-muted-foreground",
|
|
363
|
+
children: "Provider"
|
|
364
|
+
}),
|
|
365
|
+
/* @__PURE__ */ v("dd", { children: d(g) }),
|
|
366
|
+
/* @__PURE__ */ v("dt", {
|
|
367
|
+
className: "text-muted-foreground",
|
|
368
|
+
children: "Direction"
|
|
369
|
+
}),
|
|
370
|
+
/* @__PURE__ */ v("dd", { children: N ? l(N) : "—" }),
|
|
371
|
+
/* @__PURE__ */ v("dt", {
|
|
372
|
+
className: "text-muted-foreground",
|
|
373
|
+
children: "External project"
|
|
374
|
+
}),
|
|
375
|
+
/* @__PURE__ */ v("dd", { children: J ? `${k}/${j}` : "—" }),
|
|
376
|
+
/* @__PURE__ */ v("dt", {
|
|
377
|
+
className: "text-muted-foreground",
|
|
378
|
+
children: "Conflict strategy"
|
|
379
|
+
}),
|
|
380
|
+
/* @__PURE__ */ v("dd", { children: r(L) })
|
|
381
|
+
]
|
|
382
|
+
}),
|
|
383
|
+
/* @__PURE__ */ y("label", {
|
|
384
|
+
className: "flex items-start gap-2 text-sm",
|
|
385
|
+
children: [/* @__PURE__ */ v(me, {
|
|
386
|
+
checked: B,
|
|
387
|
+
onCheckedChange: (e) => xe(e === !0),
|
|
388
|
+
"data-testid": "sync-wizard-verify"
|
|
389
|
+
}), /* @__PURE__ */ y("span", { children: ["Verify the connection before creating (recommended)", /* @__PURE__ */ v("span", {
|
|
390
|
+
className: "block text-xs text-muted-foreground",
|
|
391
|
+
children: "Probes the credentials first; the sync is not created if the probe fails."
|
|
392
|
+
})] })]
|
|
393
|
+
}),
|
|
394
|
+
V && /* @__PURE__ */ v(n, { message: V }),
|
|
395
|
+
/* @__PURE__ */ y(b, {
|
|
396
|
+
onClick: () => void Te(),
|
|
397
|
+
disabled: K.loading,
|
|
398
|
+
"data-testid": "sync-wizard-create",
|
|
399
|
+
children: [K.loading ? /* @__PURE__ */ v(de, { className: "mr-1 h-4 w-4 animate-spin" }) : /* @__PURE__ */ v(fe, { className: "mr-1 h-4 w-4" }), "Create sync"]
|
|
400
|
+
})
|
|
401
|
+
]
|
|
402
|
+
})]
|
|
403
|
+
})
|
|
404
|
+
] })
|
|
405
|
+
]
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
//#endregion
|
|
409
|
+
export { D as IntegrationsNewSyncPagePage };
|
|
410
|
+
|
|
411
|
+
//# sourceMappingURL=IntegrationsNewSyncPagePage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntegrationsNewSyncPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/IntegrationsNewSyncPagePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation } from '@apollo/client/react';\nimport {\n Button,\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n Checkbox,\n Input,\n} from '@burdenoff/fe-libs/ui';\nimport { ArrowLeft, CheckCircle2, Github, Loader2, Plug, ShieldQuestion } from 'lucide-react';\nimport { usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { detailPath } from '../utils/rowNavigation';\nimport { throwOnError } from '../utils/mutationResult';\nimport { isForbidden, mutationErrorMessage } from '../utils/graphqlErrors';\nimport { ErrorLine } from '../controls/ConfirmButton';\nimport { ProjectSelect } from '../controls/Pickers';\nimport { enumLabel } from '../controls/WorkItemControls';\nimport {\n RunNowButton,\n SyncRunResultSummary,\n TestConnectionButton,\n CONFLICT_STRATEGY_EXPLANATION,\n} from '../controls/SyncControls';\nimport { useSyncProviderCapabilities } from '../integrations/useSyncProviderCapabilities';\nimport {\n CONFLICT_RESOLUTIONS,\n directionLabel,\n directionSupported,\n GITHUB_FIELD_MAPPING_DEFAULTS,\n isValidGithubOwner,\n isValidGithubRepo,\n providerIsLive,\n providerLabel,\n SYNC_DIRECTIONS,\n type ConflictResolution,\n type SyncDirection,\n type SyncProvider,\n type SyncProviderCapability,\n type SyncRunResult,\n} from '../integrations/syncTypes';\n\n/**\n * Sync setup wizard (AUT-08): create an ExternalSync step by step, driven entirely by\n * `planmagnetSupportedSyncProviders` — a provider is selectable, and a direction is offered, only when the\n * capability list says it is real, never a hard-coded \"GitHub only\" rule. Today that capability list happens to\n * make GITHUB the only live choice (BOFF-4446); the connection fields below (owner/repo/token) are GitHub's own\n * documented `connectionConfig` shape and only make sense for it — there is nothing to generalize them to until\n * a second connector ships.\n */\n\nconst label = 'text-sm font-medium';\n\nconst CREATE_SYNC = gql`\n mutation NewSyncCreate($input: PlanmagnetCreateExternalSyncInput!) {\n planmagnetCreateExternalSync(input: $input) {\n id\n provider\n status\n project {\n id\n name\n }\n }\n }\n`;\n\ninterface CreatedSync {\n id: string;\n provider: string;\n status: string;\n project: { id: string; name: string } | null;\n}\n\nfunction ProviderStep({\n capabilities,\n capabilitiesLoading,\n provider,\n onSelect,\n}: {\n capabilities: SyncProviderCapability[];\n capabilitiesLoading: boolean;\n provider: SyncProvider | '';\n onSelect: (p: SyncProvider) => void;\n}) {\n return (\n <Card data-testid=\"sync-wizard-step\">\n <CardHeader>\n <CardTitle>1. Provider</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-2\">\n {capabilitiesLoading && <p className=\"text-sm text-muted-foreground\">Loading providers…</p>}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-2\">\n {capabilities.map((c) => {\n const live = providerIsLive(c);\n const selected = provider === c.provider;\n return (\n <button\n key={c.provider}\n type=\"button\"\n disabled={!live}\n aria-pressed={selected}\n data-testid={`sync-wizard-provider-${c.provider}`}\n onClick={() => live && onSelect(c.provider)}\n className={`flex items-start gap-2 rounded-md border p-3 text-left text-sm transition-colors ${\n selected ? 'border-primary bg-primary/5' : 'border-input'\n } ${live ? 'hover:bg-muted' : 'cursor-not-allowed opacity-50'}`}\n >\n {c.provider === 'GITHUB' ? (\n <Github className=\"mt-0.5 h-4 w-4 shrink-0\" />\n ) : (\n <Plug className=\"mt-0.5 h-4 w-4 shrink-0\" />\n )}\n <span>\n <span className=\"block font-medium\">{providerLabel(c.provider)}</span>\n <span className=\"block text-xs text-muted-foreground\">\n {live\n ? [\n c.supportsImport && 'inbound',\n c.supportsExport && 'outbound',\n c.supportsBidirectional && 'bidirectional',\n ]\n .filter(Boolean)\n .join(', ') + ' sync'\n : 'No live connector yet — inbound, outbound and bidirectional sync are all unavailable for this provider.'}\n </span>\n </span>\n </button>\n );\n })}\n </div>\n </CardContent>\n </Card>\n );\n}\n\nexport function IntegrationsNewSyncPagePage() {\n const navigate = usePlanMagnetNavigate();\n const { capabilities, loading: capabilitiesLoading } = useSyncProviderCapabilities();\n\n const [provider, setProvider] = useState<SyncProvider | ''>('');\n const [projectId, setProjectId] = useState('');\n const [owner, setOwner] = useState('');\n const [repo, setRepo] = useState('');\n const [direction, setDirection] = useState<SyncDirection | ''>('');\n const [token, setToken] = useState('');\n const [conflictStrategy, setConflictStrategy] = useState<ConflictResolution>('MANUAL');\n const [priorityPrefix, setPriorityPrefix] = useState('');\n const [dueDatePrefix, setDueDatePrefix] = useState('');\n const [verifyBeforeCreate, setVerifyBeforeCreate] = useState(true);\n const [formError, setFormError] = useState<string | null>(null);\n const [created, setCreated] = useState<CreatedSync | null>(null);\n const [runResult, setRunResult] = useState<SyncRunResult | null>(null);\n\n const [create, state] = useMutation<{ planmagnetCreateExternalSync: CreatedSync }>(CREATE_SYNC, {\n refetchQueries: ['SyncsList'],\n });\n\n const capability = capabilities.find((c) => c.provider === provider);\n const isGithub = provider === 'GITHUB';\n const allowedDirections = capability\n ? SYNC_DIRECTIONS.filter((d) => directionSupported(capability, d))\n : [];\n\n const ownerValid = owner.trim() !== '' && isValidGithubOwner(owner);\n const repoValid = repo.trim() !== '' && isValidGithubRepo(repo);\n const step2Complete =\n !!provider && !!projectId && (!isGithub || (ownerValid && repoValid)) && !!direction;\n const step3Complete = step2Complete && token.trim() !== '';\n\n const buildInput = () => {\n const fieldMapping: Record<string, string> = {};\n if (priorityPrefix.trim()) fieldMapping.priority = priorityPrefix.trim();\n if (dueDatePrefix.trim()) fieldMapping.dueDate = dueDatePrefix.trim();\n return {\n projectId,\n provider,\n direction,\n externalProjectId: isGithub ? `${owner.trim()}/${repo.trim()}` : '',\n externalProjectUrl: isGithub\n ? `https://github.com/${owner.trim()}/${repo.trim()}`\n : undefined,\n connectionConfig: isGithub\n ? { token: token.trim(), owner: owner.trim(), repo: repo.trim() }\n : {},\n conflictStrategy,\n ...(Object.keys(fieldMapping).length > 0 ? { fieldMapping } : {}),\n testConnection: verifyBeforeCreate,\n };\n };\n\n const submit = async () => {\n setFormError(null);\n if (!step3Complete) {\n setFormError(\n 'Fill in the project, external project and credentials above before creating the sync.'\n );\n return;\n }\n try {\n const res = await throwOnError(create({ variables: { input: buildInput() } }));\n if (res.data) setCreated(res.data.planmagnetCreateExternalSync);\n } catch (e) {\n setFormError(\n isForbidden(e)\n ? 'Your role can view integrations but not set them up.'\n : mutationErrorMessage(e, 'The sync could not be created.')\n );\n }\n };\n\n if (created) {\n return (\n <div className=\"space-y-6 p-6 max-w-2xl\">\n <Card data-testid=\"sync-wizard-created\">\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <CheckCircle2 className=\"h-5 w-5 text-status-success-text\" />\n Sync created\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <p className=\"text-sm text-muted-foreground\">\n {providerLabel(created.provider)} sync for {created.project?.name ?? 'the project'} is\n set up and idle. Test the connection and run the first sync now, or do either later\n from the sync's own page.\n </p>\n <div className=\"flex flex-wrap items-center gap-3\">\n <TestConnectionButton syncId={created.id} />\n <RunNowButton syncId={created.id} onResult={setRunResult} />\n </div>\n {runResult && <SyncRunResultSummary result={runResult} />}\n <Button\n onClick={() => navigate(detailPath('/integrations/sync-detail-page', created.id))}\n data-testid=\"sync-wizard-view\"\n >\n View sync\n </Button>\n </CardContent>\n </Card>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6 max-w-2xl\">\n <div className=\"flex items-start gap-3\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n aria-label=\"Back to Integrations\"\n onClick={() => navigate('/integrations/syncs-page')}\n >\n <ArrowLeft className=\"h-4 w-4\" />\n </Button>\n <div>\n <h1 className=\"text-2xl font-semibold\">Set up a sync</h1>\n <p className=\"text-sm text-muted-foreground\">\n Connect a PlanMagnet project to an external issue tracker so work items stay in step on\n both sides.\n </p>\n </div>\n </div>\n\n <ProviderStep\n capabilities={capabilities}\n capabilitiesLoading={capabilitiesLoading}\n provider={provider}\n onSelect={(p) => {\n setProvider(p);\n setDirection('');\n setOwner('');\n setRepo('');\n setToken('');\n }}\n />\n\n {provider && (\n <Card data-testid=\"sync-wizard-step\">\n <CardHeader>\n <CardTitle>2. Project, external project and direction</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <div>\n <label htmlFor=\"sync-wizard-project\" className={label}>\n PlanMagnet project\n </label>\n <div className=\"mt-1\">\n <ProjectSelect\n id=\"sync-wizard-project\"\n value={projectId}\n noneLabel=\"Choose a project\"\n onChange={setProjectId}\n />\n </div>\n </div>\n {isGithub && (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-3\">\n <div>\n <label htmlFor=\"sync-wizard-owner\" className={label}>\n GitHub owner (user or org)\n </label>\n <Input\n id=\"sync-wizard-owner\"\n className=\"mt-1\"\n placeholder=\"e.g. algoshred\"\n value={owner}\n data-testid=\"sync-wizard-owner\"\n onChange={(e) => setOwner(e.target.value)}\n />\n {owner.trim() !== '' && !ownerValid && (\n <ErrorLine message=\"Not a valid GitHub owner name.\" />\n )}\n </div>\n <div>\n <label htmlFor=\"sync-wizard-repo\" className={label}>\n Repository\n </label>\n <Input\n id=\"sync-wizard-repo\"\n className=\"mt-1\"\n placeholder=\"e.g. wspace-planmagnet-svc\"\n value={repo}\n data-testid=\"sync-wizard-repo\"\n onChange={(e) => setRepo(e.target.value)}\n />\n {repo.trim() !== '' && !repoValid && (\n <ErrorLine message=\"Not a valid repository name.\" />\n )}\n </div>\n </div>\n )}\n <div>\n <span className={label}>Direction</span>\n {allowedDirections.length === 0 ? (\n <p className=\"mt-1 text-sm text-muted-foreground\">\n This provider offers no live sync direction yet.\n </p>\n ) : (\n <div className=\"mt-1 flex flex-col gap-1\" role=\"radiogroup\" aria-label=\"Direction\">\n {allowedDirections.map((d) => (\n <label key={d} className=\"flex items-center gap-2 text-sm\">\n <input\n type=\"radio\"\n name=\"sync-wizard-direction\"\n checked={direction === d}\n data-testid={`sync-wizard-direction-${d}`}\n onChange={() => setDirection(d)}\n />\n {directionLabel(d)}\n </label>\n ))}\n </div>\n )}\n </div>\n </CardContent>\n </Card>\n )}\n\n {step2Complete && (\n <Card data-testid=\"sync-wizard-step\">\n <CardHeader>\n <CardTitle>3. Credentials</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n {isGithub && (\n <>\n <p className=\"text-sm text-muted-foreground\">\n Use a GitHub fine-grained personal access token scoped to{' '}\n <strong>\n {owner}/{repo}\n </strong>\n , with Issues set to <strong>Read and write</strong> — no other repository\n permission is needed.\n </p>\n <div className=\"max-w-sm\">\n <label htmlFor=\"sync-wizard-token\" className={label}>\n Personal access token\n </label>\n <Input\n id=\"sync-wizard-token\"\n type=\"password\"\n autoComplete=\"off\"\n className=\"mt-1\"\n value={token}\n data-testid=\"sync-wizard-token\"\n onChange={(e) => setToken(e.target.value)}\n />\n </div>\n </>\n )}\n </CardContent>\n </Card>\n )}\n\n {step3Complete && (\n <>\n <Card data-testid=\"sync-wizard-step\">\n <CardHeader>\n <CardTitle>4. Conflict strategy</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-2\">\n <p className=\"text-sm text-muted-foreground\">\n What happens when the same item changed on both sides since the last sync.\n </p>\n <div className=\"flex flex-col gap-1\" role=\"radiogroup\" aria-label=\"Conflict strategy\">\n {CONFLICT_RESOLUTIONS.map((r) => (\n <label key={r} className=\"flex items-start gap-2 text-sm\">\n <input\n type=\"radio\"\n name=\"sync-wizard-strategy\"\n className=\"mt-0.5\"\n checked={conflictStrategy === r}\n data-testid={`sync-wizard-strategy-${r}`}\n onChange={() => setConflictStrategy(r)}\n />\n <span>\n <span className=\"font-medium\">{enumLabel(r)}</span>\n <span className=\"block text-xs text-muted-foreground\">\n {CONFLICT_STRATEGY_EXPLANATION[r]}\n </span>\n </span>\n </label>\n ))}\n </div>\n </CardContent>\n </Card>\n\n {isGithub && (\n <Card data-testid=\"sync-wizard-step\">\n <CardHeader>\n <CardTitle>5. Field mapping (optional)</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n <p className=\"text-sm text-muted-foreground\">\n GitHub issues have no native priority or due-date field — PlanMagnet encodes each\n as a label of the form <code>prefix+value</code> (e.g. <code>priority:HIGH</code>,{' '}\n <code>due:2026-10-01</code>\n ). Leave both blank to use the built-in prefixes.\n </p>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-3\">\n <div>\n <label\n htmlFor=\"sync-wizard-priority-prefix\"\n className=\"text-xs text-muted-foreground\"\n >\n Priority label prefix (default "{GITHUB_FIELD_MAPPING_DEFAULTS.priority}\n ")\n </label>\n <Input\n id=\"sync-wizard-priority-prefix\"\n className=\"mt-1\"\n placeholder={GITHUB_FIELD_MAPPING_DEFAULTS.priority}\n value={priorityPrefix}\n onChange={(e) => setPriorityPrefix(e.target.value)}\n />\n </div>\n <div>\n <label\n htmlFor=\"sync-wizard-duedate-prefix\"\n className=\"text-xs text-muted-foreground\"\n >\n Due-date label prefix (default "{GITHUB_FIELD_MAPPING_DEFAULTS.dueDate}\n ")\n </label>\n <Input\n id=\"sync-wizard-duedate-prefix\"\n className=\"mt-1\"\n placeholder={GITHUB_FIELD_MAPPING_DEFAULTS.dueDate}\n value={dueDatePrefix}\n onChange={(e) => setDueDatePrefix(e.target.value)}\n />\n </div>\n </div>\n </CardContent>\n </Card>\n )}\n\n <Card data-testid=\"sync-wizard-step\">\n <CardHeader>\n <CardTitle>6. Review & create</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n <dl className=\"grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-1 text-sm\">\n <dt className=\"text-muted-foreground\">Provider</dt>\n <dd>{providerLabel(provider)}</dd>\n <dt className=\"text-muted-foreground\">Direction</dt>\n <dd>{direction ? directionLabel(direction) : '—'}</dd>\n <dt className=\"text-muted-foreground\">External project</dt>\n <dd>{isGithub ? `${owner}/${repo}` : '—'}</dd>\n <dt className=\"text-muted-foreground\">Conflict strategy</dt>\n <dd>{enumLabel(conflictStrategy)}</dd>\n </dl>\n <label className=\"flex items-start gap-2 text-sm\">\n <Checkbox\n checked={verifyBeforeCreate}\n onCheckedChange={(checked) => setVerifyBeforeCreate(checked === true)}\n data-testid=\"sync-wizard-verify\"\n />\n <span>\n Verify the connection before creating (recommended)\n <span className=\"block text-xs text-muted-foreground\">\n Probes the credentials first; the sync is not created if the probe fails.\n </span>\n </span>\n </label>\n {formError && <ErrorLine message={formError} />}\n <Button\n onClick={() => void submit()}\n disabled={state.loading}\n data-testid=\"sync-wizard-create\"\n >\n {state.loading ? (\n <Loader2 className=\"mr-1 h-4 w-4 animate-spin\" />\n ) : (\n <ShieldQuestion className=\"mr-1 h-4 w-4\" />\n )}\n Create sync\n </Button>\n </CardContent>\n </Card>\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAqD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