@burdenoff/fluidgrids-fe-sdk 2026.1026.4 → 2026.1027.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/{ExecutionDetailPage-TKW7PTPB.js → ExecutionDetailPage-CRGWMW6J.js} +7 -7
- package/dist/{ExecutionsListPage-2C7EZQVY.js → ExecutionsListPage-P4I6FJX3.js} +7 -7
- package/dist/{WorkflowBuilder-HQ54BA4H.js → WorkflowBuilder-D4FMZ6NM.js} +9 -9
- package/dist/{WorkflowsList-4FJ43YXU.js → WorkflowsList-ZO7KPIG7.js} +7 -7
- package/dist/{chunk-FCLK2OJZ.js → chunk-2PQZZ6Y4.js} +2 -2
- package/dist/{chunk-BNA2HFGB.js → chunk-3UA5H5CT.js} +1 -1
- package/dist/{chunk-T7OXOUWH.js → chunk-5BF6XLMJ.js} +1 -1
- package/dist/{chunk-2C5BINPR.js → chunk-5TSO3MJL.js} +4 -4
- package/dist/{chunk-A3FL5VXL.js → chunk-BK4OICYX.js} +5 -5
- package/dist/{chunk-FP7XLLKS.js → chunk-BQWEOKPY.js} +2 -2
- package/dist/{chunk-LESDLSWT.js → chunk-IKGKMOBR.js} +1 -1
- package/dist/{chunk-SJWID3VY.js → chunk-JQ66KPU6.js} +2 -2
- package/dist/{chunk-G6ZEGIN4.js → chunk-JVBJKIV2.js} +22 -6
- package/dist/{chunk-RYNCNNTL.js → chunk-KEURSYHK.js} +1 -1
- package/dist/{chunk-CKGWBTNH.js → chunk-KQ76OJWI.js} +3 -3
- package/dist/{chunk-M6YWFM6N.js → chunk-L7ZCMJ7H.js} +3 -3
- package/dist/{chunk-6TIYZGFA.js → chunk-LR46LFJH.js} +113 -5
- package/dist/{chunk-GADIYTEC.js → chunk-LXQXMWJ6.js} +1 -1
- package/dist/{chunk-BP4WGVSM.js → chunk-MRL6QLBD.js} +1 -1
- package/dist/{chunk-YTU52PMD.js → chunk-NVXDNFVB.js} +1199 -48
- package/dist/{chunk-HEAPF24H.js → chunk-PGEG5FCW.js} +2 -2
- package/dist/{chunk-FLKTTSRJ.js → chunk-QRJ7SYR2.js} +12 -4
- package/dist/{chunk-3NTBEC3Y.js → chunk-RBAYIRXR.js} +5 -5
- package/dist/{chunk-7E3LVWEK.js → chunk-WYTARFHH.js} +3 -3
- package/dist/{chunk-43KEMTD4.js → chunk-X7IMNKTG.js} +1 -1
- package/dist/executions.js +9 -9
- package/dist/history.js +4 -4
- package/dist/index.d.ts +1129 -8
- package/dist/index.js +31 -31
- package/dist/nodes.js +2 -2
- package/dist/observability.js +4 -4
- package/dist/settings.js +4 -4
- package/dist/templates.js +8 -8
- package/dist/workflow-builder.js +10 -10
- package/dist/workflows-list.js +7 -7
- package/package.json +1 -1
|
@@ -2,16 +2,16 @@ import { deepClone, applyTemplateInputs } from './chunk-GEMNVFPK.js';
|
|
|
2
2
|
import { Input as Input$1 } from './chunk-IEVSFCFS.js';
|
|
3
3
|
import { Dialog as Dialog$1, DialogContent as DialogContent$1, DialogHeader as DialogHeader$1, DialogTitle as DialogTitle$1, DialogDescription as DialogDescription$1, DialogFooter } from './chunk-YXMFRQYV.js';
|
|
4
4
|
import { Badge as Badge$1, Button } from './chunk-BQXVT32O.js';
|
|
5
|
-
import { QuotaExhaustedDialog } from './chunk-
|
|
6
|
-
import { EntityTagPicker } from './chunk-
|
|
7
|
-
import { useWorkflowVersions, useRestoreWorkflowVersion, useActivateWorkflow, useDeleteWorkflow, useLazyWorkflowDefinition, useDeactivateWorkflow } from './chunk-
|
|
5
|
+
import { QuotaExhaustedDialog } from './chunk-IKGKMOBR.js';
|
|
6
|
+
import { EntityTagPicker } from './chunk-3UA5H5CT.js';
|
|
7
|
+
import { useWorkflowVersions, useRestoreWorkflowVersion, useActivateWorkflow, useDeleteWorkflow, useLazyWorkflowDefinition, useDeactivateWorkflow } from './chunk-2PQZZ6Y4.js';
|
|
8
8
|
import { FluidGridsDocsLink } from './chunk-4VJ3MDOV.js';
|
|
9
|
-
import { RUNS_QUOTA_NAME, throwIfResultError, useFlowStore, BILLING_PLANS_PATH, emitUpgradeClicked, FluidGridsContext, emitWorkflowCreated, emitTemplateUsed, ensureNodeConfigsLoaded, NODE_CONFIGS, registerWorkflowNodeTypes, emitNodeInstalled, useNodeExecution, onNodeTypesUpdate, NODE_TYPES, getNodeMetadata, useIsValidConnection, refetchStoreNodes, AVAILABLE_NODES, useInsertNode, NODE_TYPE_DRAG_DATA_FORMAT, NODE_OPERATION_DRAG_DATA_FORMAT, useSaveWorkflow, SdkPermissionButton, FLUIDGRIDS_PERMISSIONS, STICKY_NOTE_TYPE, fieldsFromValue, getNodeDetail, useFluidGridsAnalytics, buildOperationSeed, isNodeTrigger, buildStickyNode, fieldsFromIO, ConnectionSelector, structuredParameterType, nodeAccent, NodeTypeIcon, NODES_METADATA, resolveNodeOperation, declaredOutputFields, pathToExpression, ExpressionEditor, formatParameterValue, parseParameterValue, isNodeConfigsInitialized, resolveUiSpec, isImageIcon, NODES, synchronizeOperationUpdate, NodePropertyPanel, openRunQuotaUpgradePrompt, describeOperationError, isTriggerOperation, canRenderOperationPanel, resolveOperationName, resolveInputHandles } from './chunk-
|
|
9
|
+
import { RUNS_QUOTA_NAME, throwIfResultError, useFlowStore, BILLING_PLANS_PATH, emitUpgradeClicked, FluidGridsContext, emitWorkflowCreated, emitTemplateUsed, ensureNodeConfigsLoaded, NODE_CONFIGS, registerWorkflowNodeTypes, emitNodeInstalled, useNodeExecution, onNodeTypesUpdate, NODE_TYPES, getNodeMetadata, useIsValidConnection, refetchStoreNodes, AVAILABLE_NODES, useInsertNode, NODE_TYPE_DRAG_DATA_FORMAT, NODE_OPERATION_DRAG_DATA_FORMAT, useConnections, ConnectionFormDialog, useSaveWorkflow, SdkPermissionButton, FLUIDGRIDS_PERMISSIONS, STICKY_NOTE_TYPE, fieldsFromValue, getNodeDetail, useFluidGridsAnalytics, buildOperationSeed, isNodeTrigger, buildStickyNode, fieldsFromIO, ConnectionSelector, structuredParameterType, nodeAccent, NodeTypeIcon, NODES_METADATA, resolveNodeOperation, declaredOutputFields, subscribeWorkflowSaved, pathToExpression, ExpressionEditor, formatParameterValue, parseParameterValue, isNodeConfigsInitialized, resolveUiSpec, isImageIcon, NODES, synchronizeOperationUpdate, NodePropertyPanel, openRunQuotaUpgradePrompt, describeOperationError, isTriggerOperation, canRenderOperationPanel, resolveOperationName, resolveInputHandles } from './chunk-JVBJKIV2.js';
|
|
10
10
|
import { cn } from './chunk-JL7CASN5.js';
|
|
11
11
|
import { getGlobalStoreClient } from './chunk-PXIFUMLA.js';
|
|
12
12
|
import { getFluidGridsConfig } from './chunk-CY6KX4RG.js';
|
|
13
13
|
import { GetMyNodeInstallationsDocument, BrowseWorkflowTemplatesDocument, InstallWorkflowNodeDocument, InstallPurchasedNodeDocument, BrowseWorkflowNodesDocument, UninstallWorkflowNodeDocument, CreateStoreOrderDocument, GetNodeInstallableVersionsDocument } from './chunk-WBH2XEWO.js';
|
|
14
|
-
import { WorkspaceRunsQuotaDocument, NodeSchemaIntrospectionDocument, useWorkflowPinnedDataQuery, usePinNodeDataMutation, useUnpinNodeDataMutation, WorkflowGenerationTemplatesDocument, WorkflowGenerationDocument, GenerateWorkflowFromPromptDocument, WorkflowEnvironmentsDocument, WorkflowPromotionRequestsDocument, DeployWorkflowVersionToDevDocument, RequestWorkflowPromotionDocument, ApproveWorkflowPromotionDocument, RejectWorkflowPromotionDocument, CancelWorkflowPromotionDocument, UpdateWorkflowEnvironmentPolicyDocument, useRunFromNodeEligibilityQuery, EventRegistrationsDocument, WebhookTestListenerDocument, StopWebhookTestListenerDocument, ListenForWebhookTestEventDocument, NodeUsageStatusDocument, RemoveNodeFromWorkflowsDocument } from './chunk-
|
|
14
|
+
import { WorkspaceRunsQuotaDocument, NodeSchemaIntrospectionDocument, useWorkflowPinnedDataQuery, usePinNodeDataMutation, useUnpinNodeDataMutation, WorkflowGenerationTemplatesDocument, WorkflowGenerationDocument, GenerateWorkflowFromPromptDocument, WorkflowEnvironmentsDocument, WorkflowPromotionRequestsDocument, DeployWorkflowVersionToDevDocument, RequestWorkflowPromotionDocument, ApproveWorkflowPromotionDocument, RejectWorkflowPromotionDocument, CancelWorkflowPromotionDocument, UpdateWorkflowEnvironmentPolicyDocument, WorkflowGitRepositoryDocument, WorkflowGitPushesDocument, WorkflowGitCommitsDocument, LinkWorkflowGitRepositoryDocument, UnlinkWorkflowGitRepositoryDocument, PushWorkflowToGitDocument, WorkflowGitDiffDocument, RestoreWorkflowFromGitDocument, useRunFromNodeEligibilityQuery, EventRegistrationsDocument, WebhookTestListenerDocument, StopWebhookTestListenerDocument, ListenForWebhookTestEventDocument, NodeUsageStatusDocument, RemoveNodeFromWorkflowsDocument } from './chunk-QRJ7SYR2.js';
|
|
15
15
|
import { useTr } from './chunk-UULVIT25.js';
|
|
16
16
|
import { getFluidGridsClient, waitForFluidGridsClient, getFluidGridsClientSafe } from './chunk-NTWG3CJX.js';
|
|
17
17
|
import * as React3 from 'react';
|
|
@@ -25,7 +25,7 @@ import { useEventBus } from '@burdenoff/fe-libs/shared/events';
|
|
|
25
25
|
import { useQuery, useMutation } from '@apollo/client/react';
|
|
26
26
|
import { gql as gql$1 } from '@apollo/client/core';
|
|
27
27
|
import 'jszip';
|
|
28
|
-
import { Sparkles, Star, Download, Eye, Loader2, History, GitCompareArrows, Play, RotateCcw, Trash2, Layers, Upload, Rocket, ArrowRight, Check, X, Undo2, Maximize2, Redo2, LayoutGrid, Keyboard,
|
|
28
|
+
import { Sparkles, Star, Download, Eye, Loader2, History, GitCompareArrows, Play, RotateCcw, Trash2, Layers, Upload, Rocket, ArrowRight, Check, X, Undo2, Plus, Link2, GitBranch, Unlink, GitCompare, ExternalLink, GitCommitHorizontal, Maximize2, Redo2, LayoutGrid, Keyboard, AlertCircle, Search, RefreshCw, CheckCircle2, Package, Info, Copy, BadgeCheck, DollarSign, Type, Code, Hash, List, Braces, Workflow, PlusCircle, ChevronDown, ChevronRight, AlertTriangle } from 'lucide-react';
|
|
29
29
|
import { Icon } from '@iconify/react';
|
|
30
30
|
import { toast } from 'sonner';
|
|
31
31
|
import { useShallow, shallow } from 'zustand/shallow';
|
|
@@ -6456,8 +6456,8 @@ var reducer = (state, action) => {
|
|
|
6456
6456
|
if (toastId) {
|
|
6457
6457
|
addToRemoveQueue(toastId);
|
|
6458
6458
|
} else {
|
|
6459
|
-
state.toasts.forEach((
|
|
6460
|
-
addToRemoveQueue(
|
|
6459
|
+
state.toasts.forEach((toast13) => {
|
|
6460
|
+
addToRemoveQueue(toast13.id);
|
|
6461
6461
|
});
|
|
6462
6462
|
}
|
|
6463
6463
|
return {
|
|
@@ -7833,7 +7833,7 @@ function VisualMapperContent({
|
|
|
7833
7833
|
mapping,
|
|
7834
7834
|
onMappingChange
|
|
7835
7835
|
}) {
|
|
7836
|
-
const { toast:
|
|
7836
|
+
const { toast: toast13 } = useToast();
|
|
7837
7837
|
const tr = useTr();
|
|
7838
7838
|
const reactFlowWrapper = useRef(null);
|
|
7839
7839
|
const [selectedSourceNode, setSelectedSourceNode] = useState(null);
|
|
@@ -7853,7 +7853,7 @@ function VisualMapperContent({
|
|
|
7853
7853
|
targetOperation
|
|
7854
7854
|
);
|
|
7855
7855
|
if (generatedNodes.length === 0) {
|
|
7856
|
-
|
|
7856
|
+
toast13({
|
|
7857
7857
|
title: tr(
|
|
7858
7858
|
"fluidgrids.builder.visualMapper.noFieldsFoundTitle",
|
|
7859
7859
|
"No fields found"
|
|
@@ -7879,7 +7879,7 @@ function VisualMapperContent({
|
|
|
7879
7879
|
targetNode,
|
|
7880
7880
|
targetOperation,
|
|
7881
7881
|
setNodes,
|
|
7882
|
-
|
|
7882
|
+
toast13,
|
|
7883
7883
|
tr
|
|
7884
7884
|
]);
|
|
7885
7885
|
useEffect(() => {
|
|
@@ -7986,7 +7986,7 @@ function VisualMapperContent({
|
|
|
7986
7986
|
}
|
|
7987
7987
|
onMappingChange(updatedMapping);
|
|
7988
7988
|
if (isCompatible) {
|
|
7989
|
-
|
|
7989
|
+
toast13({
|
|
7990
7990
|
title: tr(
|
|
7991
7991
|
"fluidgrids.builder.visualMapper.mappingCreatedTitle",
|
|
7992
7992
|
"Mapping created"
|
|
@@ -7994,7 +7994,7 @@ function VisualMapperContent({
|
|
|
7994
7994
|
description: `Mapped ${sourcePath} (${sourceType}) to ${targetPath} (${targetType})`
|
|
7995
7995
|
});
|
|
7996
7996
|
} else {
|
|
7997
|
-
|
|
7997
|
+
toast13({
|
|
7998
7998
|
title: tr(
|
|
7999
7999
|
"fluidgrids.builder.visualMapper.typeMismatchTitle",
|
|
8000
8000
|
"Type mismatch warning"
|
|
@@ -8004,7 +8004,7 @@ function VisualMapperContent({
|
|
|
8004
8004
|
});
|
|
8005
8005
|
}
|
|
8006
8006
|
} else {
|
|
8007
|
-
|
|
8007
|
+
toast13({
|
|
8008
8008
|
title: tr(
|
|
8009
8009
|
"fluidgrids.builder.visualMapper.invalidMappingTitle",
|
|
8010
8010
|
"Invalid mapping"
|
|
@@ -8017,7 +8017,7 @@ function VisualMapperContent({
|
|
|
8017
8017
|
});
|
|
8018
8018
|
}
|
|
8019
8019
|
},
|
|
8020
|
-
[nodes, mapping, onMappingChange,
|
|
8020
|
+
[nodes, mapping, onMappingChange, toast13, tr, setEdges]
|
|
8021
8021
|
);
|
|
8022
8022
|
const onEdgeDelete = useCallback(
|
|
8023
8023
|
(edge) => {
|
|
@@ -8074,7 +8074,7 @@ function VisualMapperContent({
|
|
|
8074
8074
|
const handleSaveMappingDialog = (expression, targetFieldName) => {
|
|
8075
8075
|
const targetPath = targetFieldName || selectedTargetNode?.data?.path;
|
|
8076
8076
|
if (!targetPath) {
|
|
8077
|
-
|
|
8077
|
+
toast13({
|
|
8078
8078
|
title: tr(
|
|
8079
8079
|
"fluidgrids.builder.visualMapper.noTargetFieldTitle",
|
|
8080
8080
|
"No target field specified"
|
|
@@ -8106,7 +8106,7 @@ function VisualMapperContent({
|
|
|
8106
8106
|
}
|
|
8107
8107
|
onMappingChange(updatedMapping);
|
|
8108
8108
|
const mappingType = detectMappingType(expression);
|
|
8109
|
-
|
|
8109
|
+
toast13({
|
|
8110
8110
|
title: `${mappingType.charAt(0).toUpperCase() + mappingType.slice(1)} mapping created`,
|
|
8111
8111
|
description: `${tr("fluidgrids.builder.visualMapper.appliedMappingTo", "Applied mapping to")} ${targetPath}`
|
|
8112
8112
|
});
|
|
@@ -8405,7 +8405,7 @@ function MappingEditor({
|
|
|
8405
8405
|
setEdges,
|
|
8406
8406
|
edgeId
|
|
8407
8407
|
}) {
|
|
8408
|
-
const { toast:
|
|
8408
|
+
const { toast: toast13 } = useToast();
|
|
8409
8409
|
const tr = useTr();
|
|
8410
8410
|
const [mappingJson, setMappingJson] = useState({});
|
|
8411
8411
|
const [jsonDataString, setJsonDataString] = useState(
|
|
@@ -8529,7 +8529,7 @@ function MappingEditor({
|
|
|
8529
8529
|
const handleSaveMapping = () => {
|
|
8530
8530
|
try {
|
|
8531
8531
|
checkJsonValidity();
|
|
8532
|
-
|
|
8532
|
+
toast13({
|
|
8533
8533
|
title: tr(
|
|
8534
8534
|
"fluidgrids.builder.mappingEditor.mappingSavedTitle",
|
|
8535
8535
|
"Mapping saved"
|
|
@@ -8540,7 +8540,7 @@ function MappingEditor({
|
|
|
8540
8540
|
)
|
|
8541
8541
|
});
|
|
8542
8542
|
} catch (error) {
|
|
8543
|
-
|
|
8543
|
+
toast13({
|
|
8544
8544
|
title: tr(
|
|
8545
8545
|
"fluidgrids.builder.mappingEditor.errorSavingTitle",
|
|
8546
8546
|
"Error saving mapping"
|
|
@@ -8559,7 +8559,7 @@ function MappingEditor({
|
|
|
8559
8559
|
const parsedData = checkJsonValidity();
|
|
8560
8560
|
const result = await applyMapping(parsedData, sampleInput);
|
|
8561
8561
|
setPreviewOutput(result);
|
|
8562
|
-
|
|
8562
|
+
toast13({
|
|
8563
8563
|
title: tr(
|
|
8564
8564
|
"fluidgrids.builder.mappingEditor.mappingTestedTitle",
|
|
8565
8565
|
"Mapping tested"
|
|
@@ -8571,7 +8571,7 @@ function MappingEditor({
|
|
|
8571
8571
|
});
|
|
8572
8572
|
} catch (error) {
|
|
8573
8573
|
console.error("Test mapping error:", error);
|
|
8574
|
-
|
|
8574
|
+
toast13({
|
|
8575
8575
|
title: tr(
|
|
8576
8576
|
"fluidgrids.builder.mappingEditor.mappingTestFailedTitle",
|
|
8577
8577
|
"Mapping test failed"
|
|
@@ -14951,6 +14951,38 @@ function SwitchRulesEditor({
|
|
|
14951
14951
|
) })
|
|
14952
14952
|
] });
|
|
14953
14953
|
}
|
|
14954
|
+
|
|
14955
|
+
// src/builder/lib/loop-return-status.ts
|
|
14956
|
+
function loopReturnStatus(nodeId, edges, loopHandle = "loop") {
|
|
14957
|
+
const enabled = edges.filter(
|
|
14958
|
+
(edge) => edge.disabled !== true && edge.data?.disabled !== true
|
|
14959
|
+
);
|
|
14960
|
+
const queue = enabled.filter(
|
|
14961
|
+
(edge) => (edge.source ?? edge.from) === nodeId && (edge.sourceHandle ?? edge.fromHandle ?? "loop") === loopHandle
|
|
14962
|
+
).map((edge) => edge.target ?? edge.to).filter((target) => typeof target === "string");
|
|
14963
|
+
const visited = /* @__PURE__ */ new Set();
|
|
14964
|
+
let returns = false;
|
|
14965
|
+
let exits = false;
|
|
14966
|
+
for (let index = 0; index < queue.length; index++) {
|
|
14967
|
+
const current = queue[index];
|
|
14968
|
+
if (current === nodeId) {
|
|
14969
|
+
returns = true;
|
|
14970
|
+
continue;
|
|
14971
|
+
}
|
|
14972
|
+
if (!current || visited.has(current)) continue;
|
|
14973
|
+
visited.add(current);
|
|
14974
|
+
const outgoing = enabled.filter(
|
|
14975
|
+
(edge) => (edge.source ?? edge.from) === current
|
|
14976
|
+
);
|
|
14977
|
+
if (outgoing.length === 0) exits = true;
|
|
14978
|
+
for (const edge of outgoing) {
|
|
14979
|
+
const target = edge.target ?? edge.to;
|
|
14980
|
+
if (target) queue.push(target);
|
|
14981
|
+
}
|
|
14982
|
+
}
|
|
14983
|
+
if (!returns) return "missing-return";
|
|
14984
|
+
return exits ? "conditional-exit" : "connected";
|
|
14985
|
+
}
|
|
14954
14986
|
function normalizeCodeLanguage(value) {
|
|
14955
14987
|
return typeof value === "string" && value.toLowerCase().startsWith("py") ? "python" : "javascript";
|
|
14956
14988
|
}
|
|
@@ -15251,10 +15283,19 @@ function useBuilderReadOnly() {
|
|
|
15251
15283
|
return useContext(BuilderReadOnlyContext);
|
|
15252
15284
|
}
|
|
15253
15285
|
var SECTION_LABEL2 = "text-[11px] font-semibold uppercase tracking-[0.12em] text-muted-foreground";
|
|
15286
|
+
function isSafeHttpUrl(value) {
|
|
15287
|
+
try {
|
|
15288
|
+
const parsed = new URL(value);
|
|
15289
|
+
return parsed.protocol === "https:" || parsed.protocol === "http:";
|
|
15290
|
+
} catch {
|
|
15291
|
+
return false;
|
|
15292
|
+
}
|
|
15293
|
+
}
|
|
15254
15294
|
function CopyableUrl({
|
|
15255
15295
|
url,
|
|
15256
15296
|
copyAriaLabel,
|
|
15257
|
-
testId
|
|
15297
|
+
testId,
|
|
15298
|
+
openLabel
|
|
15258
15299
|
}) {
|
|
15259
15300
|
const tr = useTr();
|
|
15260
15301
|
const [copied, setCopied] = useState(false);
|
|
@@ -15298,6 +15339,20 @@ function CopyableUrl({
|
|
|
15298
15339
|
copied ? tr("fluidgrids.builder.webhookUrlField.copied", "Copied") : tr("fluidgrids.builder.webhookUrlField.copy", "Copy")
|
|
15299
15340
|
]
|
|
15300
15341
|
}
|
|
15342
|
+
),
|
|
15343
|
+
openLabel && /* @__PURE__ */ jsxs(
|
|
15344
|
+
"a",
|
|
15345
|
+
{
|
|
15346
|
+
href: url,
|
|
15347
|
+
target: "_blank",
|
|
15348
|
+
rel: "noopener noreferrer",
|
|
15349
|
+
"data-testid": `${testId}-open`,
|
|
15350
|
+
className: "inline-flex shrink-0 items-center gap-1.5 rounded-md border border-border bg-background px-3 py-2 text-xs font-medium text-foreground transition-colors hover:bg-muted",
|
|
15351
|
+
children: [
|
|
15352
|
+
/* @__PURE__ */ jsx(Icon, { icon: "mdi:open-in-new", className: "h-4 w-4" }),
|
|
15353
|
+
openLabel
|
|
15354
|
+
]
|
|
15355
|
+
}
|
|
15301
15356
|
)
|
|
15302
15357
|
] });
|
|
15303
15358
|
}
|
|
@@ -15340,6 +15395,50 @@ function WebhookUrlField({ webhookUrl, loading }) {
|
|
|
15340
15395
|
) })
|
|
15341
15396
|
] });
|
|
15342
15397
|
}
|
|
15398
|
+
function FormUrlField({ formUrl, loading, error }) {
|
|
15399
|
+
const tr = useTr();
|
|
15400
|
+
const safeUrl = formUrl && isSafeHttpUrl(formUrl) ? formUrl : null;
|
|
15401
|
+
let message = null;
|
|
15402
|
+
if (!safeUrl || error) {
|
|
15403
|
+
if (error || formUrl) {
|
|
15404
|
+
message = tr(
|
|
15405
|
+
"fluidgrids.builder.formUrlField.error",
|
|
15406
|
+
"Unable to load a safe trigger URL."
|
|
15407
|
+
);
|
|
15408
|
+
} else if (loading) {
|
|
15409
|
+
message = tr(
|
|
15410
|
+
"fluidgrids.builder.formUrlField.loading",
|
|
15411
|
+
"Loading form URL\u2026"
|
|
15412
|
+
);
|
|
15413
|
+
} else {
|
|
15414
|
+
message = tr(
|
|
15415
|
+
"fluidgrids.builder.formUrlField.unsaved",
|
|
15416
|
+
"Save the workflow to generate its form URL."
|
|
15417
|
+
);
|
|
15418
|
+
}
|
|
15419
|
+
}
|
|
15420
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-2", "data-testid": "ndv-form-url", children: [
|
|
15421
|
+
/* @__PURE__ */ jsx("div", { className: SECTION_LABEL2, children: tr("fluidgrids.builder.formUrlField.label", "Form URL") }),
|
|
15422
|
+
safeUrl && !error ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15423
|
+
/* @__PURE__ */ jsx(
|
|
15424
|
+
CopyableUrl,
|
|
15425
|
+
{
|
|
15426
|
+
url: safeUrl,
|
|
15427
|
+
testId: "ndv-form-url-value",
|
|
15428
|
+
copyAriaLabel: tr(
|
|
15429
|
+
"fluidgrids.builder.formUrlField.copyAriaLabel",
|
|
15430
|
+
"Copy form URL"
|
|
15431
|
+
),
|
|
15432
|
+
openLabel: tr("fluidgrids.builder.formUrlField.open", "Open form")
|
|
15433
|
+
}
|
|
15434
|
+
),
|
|
15435
|
+
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-muted-foreground", children: tr(
|
|
15436
|
+
"fluidgrids.builder.formUrlField.hint",
|
|
15437
|
+
"Share this link to collect submissions; each submission starts the workflow's active version."
|
|
15438
|
+
) })
|
|
15439
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "rounded-md border border-dashed border-border bg-muted/40 px-3 py-2 text-xs text-muted-foreground", children: message })
|
|
15440
|
+
] });
|
|
15441
|
+
}
|
|
15343
15442
|
function useSecondsLeft(expiresAt) {
|
|
15344
15443
|
const [now, setNow] = useState(() => Date.now());
|
|
15345
15444
|
useEffect(() => {
|
|
@@ -16178,20 +16277,23 @@ function updateMappingDefinition(definition, field, value) {
|
|
|
16178
16277
|
return { ...definition, [field]: value };
|
|
16179
16278
|
}
|
|
16180
16279
|
function useWebhookRegistration(workflowKey, triggerNodeId, enabled = true) {
|
|
16181
|
-
const [
|
|
16182
|
-
|
|
16183
|
-
);
|
|
16184
|
-
const [loading, setLoading] = useState(false);
|
|
16185
|
-
const [error, setError] = useState(null);
|
|
16280
|
+
const key = enabled && workflowKey && triggerNodeId ? JSON.stringify([workflowKey, triggerNodeId]) : null;
|
|
16281
|
+
const requestId = useRef(0);
|
|
16282
|
+
const [state, setState] = useState({ key: null, registration: null, loading: false, error: null });
|
|
16186
16283
|
const fetchData = useCallback(async () => {
|
|
16187
|
-
|
|
16188
|
-
|
|
16284
|
+
const currentRequest = ++requestId.current;
|
|
16285
|
+
if (!key || !workflowKey || !triggerNodeId) return;
|
|
16286
|
+
const client = getFluidGridsClientSafe();
|
|
16287
|
+
if (!client) {
|
|
16288
|
+
setState({
|
|
16289
|
+
key,
|
|
16290
|
+
registration: null,
|
|
16291
|
+
loading: false,
|
|
16292
|
+
error: new Error("Workflow client unavailable")
|
|
16293
|
+
});
|
|
16189
16294
|
return;
|
|
16190
16295
|
}
|
|
16191
|
-
|
|
16192
|
-
if (!client) return;
|
|
16193
|
-
setLoading(true);
|
|
16194
|
-
setError(null);
|
|
16296
|
+
setState({ key, registration: null, loading: true, error: null });
|
|
16195
16297
|
try {
|
|
16196
16298
|
const result = await client.query({
|
|
16197
16299
|
query: EventRegistrationsDocument,
|
|
@@ -16201,21 +16303,38 @@ function useWebhookRegistration(workflowKey, triggerNodeId, enabled = true) {
|
|
|
16201
16303
|
const match = result.data?.eventRegistrations?.find(
|
|
16202
16304
|
(r) => r.triggerNodeId === triggerNodeId
|
|
16203
16305
|
) ?? null;
|
|
16204
|
-
|
|
16306
|
+
if (currentRequest === requestId.current)
|
|
16307
|
+
setState({ key, registration: match, loading: false, error: null });
|
|
16205
16308
|
} catch (err) {
|
|
16206
|
-
|
|
16207
|
-
|
|
16208
|
-
|
|
16309
|
+
if (currentRequest === requestId.current)
|
|
16310
|
+
setState({
|
|
16311
|
+
key,
|
|
16312
|
+
registration: null,
|
|
16313
|
+
loading: false,
|
|
16314
|
+
error: err instanceof Error ? err : new Error("Unable to load trigger URL")
|
|
16315
|
+
});
|
|
16209
16316
|
}
|
|
16210
|
-
}, [
|
|
16317
|
+
}, [key, workflowKey, triggerNodeId]);
|
|
16211
16318
|
useEffect(() => {
|
|
16212
16319
|
fetchData();
|
|
16320
|
+
return () => {
|
|
16321
|
+
requestId.current += 1;
|
|
16322
|
+
};
|
|
16213
16323
|
}, [fetchData]);
|
|
16324
|
+
useEffect(() => {
|
|
16325
|
+
if (!enabled || !workflowKey) return;
|
|
16326
|
+
return subscribeWorkflowSaved(workflowKey, () => {
|
|
16327
|
+
void fetchData();
|
|
16328
|
+
});
|
|
16329
|
+
}, [enabled, workflowKey, fetchData]);
|
|
16330
|
+
const current = state.key === key && key !== null ? state : null;
|
|
16331
|
+
const registration = current?.registration ?? null;
|
|
16214
16332
|
return {
|
|
16215
16333
|
registration,
|
|
16216
16334
|
webhookUrl: registration?.webhookUrl ?? null,
|
|
16217
|
-
|
|
16218
|
-
|
|
16335
|
+
formUrl: registration?.formUrl ?? null,
|
|
16336
|
+
loading: current?.loading ?? !!key,
|
|
16337
|
+
error: current?.error ?? null,
|
|
16219
16338
|
refetch: fetchData
|
|
16220
16339
|
};
|
|
16221
16340
|
}
|
|
@@ -16406,10 +16525,19 @@ function useNodeConfig(target, options) {
|
|
|
16406
16525
|
() => !!asRecord(currentOp?.output_fields)?.webhookUrl,
|
|
16407
16526
|
[currentOp]
|
|
16408
16527
|
);
|
|
16409
|
-
const
|
|
16528
|
+
const isFormTrigger = useMemo(
|
|
16529
|
+
() => !!asRecord(currentOp?.output_fields)?.formUrl,
|
|
16530
|
+
[currentOp]
|
|
16531
|
+
);
|
|
16532
|
+
const {
|
|
16533
|
+
webhookUrl,
|
|
16534
|
+
formUrl,
|
|
16535
|
+
error: triggerUrlError,
|
|
16536
|
+
loading: webhookUrlLoading
|
|
16537
|
+
} = useWebhookRegistration(
|
|
16410
16538
|
workflowKey || void 0,
|
|
16411
16539
|
node?.id,
|
|
16412
|
-
isWebhookTrigger && (options?.webhookEnabled ?? true)
|
|
16540
|
+
(isWebhookTrigger || isFormTrigger) && (options?.webhookEnabled ?? true)
|
|
16413
16541
|
);
|
|
16414
16542
|
const pickerFields = useMemo(() => flattenFields(inputFields), [inputFields]);
|
|
16415
16543
|
const mapping = currentEdge?.mapping?.definition ?? {};
|
|
@@ -16622,6 +16750,9 @@ function useNodeConfig(target, options) {
|
|
|
16622
16750
|
connectionAdapters,
|
|
16623
16751
|
selectedConnections,
|
|
16624
16752
|
isWebhookTrigger,
|
|
16753
|
+
isFormTrigger,
|
|
16754
|
+
formUrl,
|
|
16755
|
+
triggerUrlError,
|
|
16625
16756
|
isWebhookWait,
|
|
16626
16757
|
webhookUrl,
|
|
16627
16758
|
webhookUrlLoading,
|
|
@@ -16751,6 +16882,12 @@ function NodeParamsForm({
|
|
|
16751
16882
|
testIdPrefix = "ndv"
|
|
16752
16883
|
}) {
|
|
16753
16884
|
const tr = useTr();
|
|
16885
|
+
const edges = useFlowStore((state) => state.workflow.edges);
|
|
16886
|
+
const loopStatus = (nodeType === "internal:loop" || nodeType === "loop") && config.node ? loopReturnStatus(
|
|
16887
|
+
config.node.id,
|
|
16888
|
+
edges,
|
|
16889
|
+
typeof config.argsState.loopHandle === "string" ? config.argsState.loopHandle : "loop"
|
|
16890
|
+
) : void 0;
|
|
16754
16891
|
const {
|
|
16755
16892
|
params,
|
|
16756
16893
|
argsState,
|
|
@@ -16759,6 +16896,9 @@ function NodeParamsForm({
|
|
|
16759
16896
|
connectionAdapters,
|
|
16760
16897
|
selectedConnections,
|
|
16761
16898
|
isWebhookTrigger,
|
|
16899
|
+
isFormTrigger,
|
|
16900
|
+
formUrl,
|
|
16901
|
+
triggerUrlError,
|
|
16762
16902
|
isWebhookWait,
|
|
16763
16903
|
webhookUrl,
|
|
16764
16904
|
webhookUrlLoading,
|
|
@@ -16786,6 +16926,30 @@ function NodeParamsForm({
|
|
|
16786
16926
|
return "1.0.0";
|
|
16787
16927
|
})();
|
|
16788
16928
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16929
|
+
loopStatus === "missing-return" && /* @__PURE__ */ jsx(
|
|
16930
|
+
"p",
|
|
16931
|
+
{
|
|
16932
|
+
role: "status",
|
|
16933
|
+
"data-testid": `${testIdPrefix}-loop-return-hint`,
|
|
16934
|
+
className: "text-xs text-muted-foreground",
|
|
16935
|
+
children: tr(
|
|
16936
|
+
"fluidgrids.builder.loopPanel.missingReturn",
|
|
16937
|
+
"No Loop Body return path is connected. Only the first batch will run unless you connect a body node back to this Loop. An intentional early exit is allowed; Done does not run on that exit."
|
|
16938
|
+
)
|
|
16939
|
+
}
|
|
16940
|
+
),
|
|
16941
|
+
loopStatus === "conditional-exit" && /* @__PURE__ */ jsx(
|
|
16942
|
+
"p",
|
|
16943
|
+
{
|
|
16944
|
+
role: "status",
|
|
16945
|
+
"data-testid": `${testIdPrefix}-loop-return-hint`,
|
|
16946
|
+
className: "text-xs text-muted-foreground",
|
|
16947
|
+
children: tr(
|
|
16948
|
+
"fluidgrids.builder.loopPanel.conditionalExit",
|
|
16949
|
+
"A return path and a possible early exit are connected. Conditional exits are allowed; Done runs only when the Loop finishes or reaches its safety limit."
|
|
16950
|
+
)
|
|
16951
|
+
}
|
|
16952
|
+
),
|
|
16789
16953
|
isWebhookTrigger && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16790
16954
|
/* @__PURE__ */ jsx(
|
|
16791
16955
|
WebhookUrlField,
|
|
@@ -16796,6 +16960,14 @@ function NodeParamsForm({
|
|
|
16796
16960
|
),
|
|
16797
16961
|
/* @__PURE__ */ jsx(WebhookTestListenerField, { nodeId: config.node?.id })
|
|
16798
16962
|
] }),
|
|
16963
|
+
isFormTrigger && /* @__PURE__ */ jsx(
|
|
16964
|
+
FormUrlField,
|
|
16965
|
+
{
|
|
16966
|
+
formUrl,
|
|
16967
|
+
loading: webhookUrlLoading,
|
|
16968
|
+
error: triggerUrlError
|
|
16969
|
+
}
|
|
16970
|
+
),
|
|
16799
16971
|
isWebhookWait && /* @__PURE__ */ jsx(WaitResumeUrlField, {}),
|
|
16800
16972
|
connectionAdapters.length > 0 && /* @__PURE__ */ jsxs("div", { className: "space-y-2", "data-testid": `${testIdPrefix}-connections`, children: [
|
|
16801
16973
|
/* @__PURE__ */ jsx("div", { className: SECTION_LABEL3, children: tr(
|
|
@@ -20238,7 +20410,8 @@ function EnvironmentsPanel({
|
|
|
20238
20410
|
) : [
|
|
20239
20411
|
state.promotedFrom ? `${tr("fluidgrids.builder.environments.from", "From")} ${envLabel(state.promotedFrom)}` : null,
|
|
20240
20412
|
deployer,
|
|
20241
|
-
relativeTime(state.deployedAt)
|
|
20413
|
+
relativeTime(state.deployedAt),
|
|
20414
|
+
state.gitCommitSha ? `Git ${state.gitCommitSha.slice(0, 7)}` : null
|
|
20242
20415
|
].filter(Boolean).join(" \xB7 ") }),
|
|
20243
20416
|
/* @__PURE__ */ jsxs("div", { className: "mt-2 flex flex-wrap gap-2", children: [
|
|
20244
20417
|
state.environment === "DEV" && currentVersion && /* @__PURE__ */ jsxs(
|
|
@@ -20512,7 +20685,8 @@ function EnvironmentsPanel({
|
|
|
20512
20685
|
/* @__PURE__ */ jsx("p", { className: "truncate text-muted-foreground", children: [
|
|
20513
20686
|
nameOf(item.requestedById),
|
|
20514
20687
|
item.reviewedById && item.reviewedById !== item.requestedById ? `${tr("fluidgrids.builder.environments.reviewedBy", "reviewed by")} ${nameOf(item.reviewedById)}` : null,
|
|
20515
|
-
relativeTime(item.requestedAt)
|
|
20688
|
+
relativeTime(item.requestedAt),
|
|
20689
|
+
item.gitCommitSha ? `Git ${item.gitCommitSha.slice(0, 7)}` : null
|
|
20516
20690
|
].filter(Boolean).join(" \xB7 ") })
|
|
20517
20691
|
] }),
|
|
20518
20692
|
/* @__PURE__ */ jsx(
|
|
@@ -20582,6 +20756,981 @@ function EnvironmentsPanel({
|
|
|
20582
20756
|
)
|
|
20583
20757
|
] });
|
|
20584
20758
|
}
|
|
20759
|
+
var LIST_LIMIT = 20;
|
|
20760
|
+
function messageOf2(error) {
|
|
20761
|
+
return error instanceof Error ? error.message : String(error);
|
|
20762
|
+
}
|
|
20763
|
+
function useWorkflowGitSync(workflowKey) {
|
|
20764
|
+
const [repository, setRepository] = useState(null);
|
|
20765
|
+
const [commits, setCommits] = useState([]);
|
|
20766
|
+
const [pushes, setPushes] = useState([]);
|
|
20767
|
+
const [loading, setLoading] = useState(false);
|
|
20768
|
+
const [error, setError] = useState(null);
|
|
20769
|
+
const [historyError, setHistoryError] = useState(null);
|
|
20770
|
+
const keyRef = useRef(workflowKey);
|
|
20771
|
+
keyRef.current = workflowKey;
|
|
20772
|
+
const refetch = useCallback(async () => {
|
|
20773
|
+
if (!workflowKey) return;
|
|
20774
|
+
setLoading(true);
|
|
20775
|
+
setError(null);
|
|
20776
|
+
setHistoryError(null);
|
|
20777
|
+
try {
|
|
20778
|
+
const client = getFluidGridsClient();
|
|
20779
|
+
const [linked, pushed] = await Promise.all([
|
|
20780
|
+
client.query({
|
|
20781
|
+
query: WorkflowGitRepositoryDocument,
|
|
20782
|
+
fetchPolicy: "network-only"
|
|
20783
|
+
}),
|
|
20784
|
+
client.query({
|
|
20785
|
+
query: WorkflowGitPushesDocument,
|
|
20786
|
+
variables: { workflowKey, limit: LIST_LIMIT },
|
|
20787
|
+
fetchPolicy: "network-only"
|
|
20788
|
+
})
|
|
20789
|
+
]);
|
|
20790
|
+
throwIfResultError(linked);
|
|
20791
|
+
throwIfResultError(pushed);
|
|
20792
|
+
if (keyRef.current !== workflowKey) return;
|
|
20793
|
+
const link2 = linked.data?.workflowGitRepository ?? null;
|
|
20794
|
+
setRepository(link2);
|
|
20795
|
+
setPushes(pushed.data?.workflowGitPushes ?? []);
|
|
20796
|
+
if (!link2) {
|
|
20797
|
+
setCommits([]);
|
|
20798
|
+
return;
|
|
20799
|
+
}
|
|
20800
|
+
try {
|
|
20801
|
+
const history = await client.query({
|
|
20802
|
+
query: WorkflowGitCommitsDocument,
|
|
20803
|
+
variables: { workflowKey, limit: LIST_LIMIT },
|
|
20804
|
+
fetchPolicy: "network-only"
|
|
20805
|
+
});
|
|
20806
|
+
throwIfResultError(history);
|
|
20807
|
+
if (keyRef.current === workflowKey) {
|
|
20808
|
+
setCommits(history.data?.workflowGitCommits ?? []);
|
|
20809
|
+
}
|
|
20810
|
+
} catch (err) {
|
|
20811
|
+
if (keyRef.current === workflowKey) {
|
|
20812
|
+
setCommits([]);
|
|
20813
|
+
setHistoryError(messageOf2(err));
|
|
20814
|
+
}
|
|
20815
|
+
}
|
|
20816
|
+
} catch (err) {
|
|
20817
|
+
if (keyRef.current === workflowKey) setError(messageOf2(err));
|
|
20818
|
+
} finally {
|
|
20819
|
+
if (keyRef.current === workflowKey) setLoading(false);
|
|
20820
|
+
}
|
|
20821
|
+
}, [workflowKey]);
|
|
20822
|
+
useEffect(() => {
|
|
20823
|
+
setRepository(null);
|
|
20824
|
+
setCommits([]);
|
|
20825
|
+
setPushes([]);
|
|
20826
|
+
}, [workflowKey]);
|
|
20827
|
+
const link = useCallback(
|
|
20828
|
+
async (values) => {
|
|
20829
|
+
const result = await getFluidGridsClient().mutate({
|
|
20830
|
+
mutation: LinkWorkflowGitRepositoryDocument,
|
|
20831
|
+
variables: {
|
|
20832
|
+
input: {
|
|
20833
|
+
provider: "GITHUB",
|
|
20834
|
+
connectionId: values.connectionId,
|
|
20835
|
+
repository: values.repository.trim(),
|
|
20836
|
+
branch: values.branch.trim(),
|
|
20837
|
+
pathPrefix: values.pathPrefix.trim(),
|
|
20838
|
+
pushOnActivation: values.pushOnActivation,
|
|
20839
|
+
pushOnPromotion: values.pushOnPromotion
|
|
20840
|
+
}
|
|
20841
|
+
}
|
|
20842
|
+
});
|
|
20843
|
+
throwIfResultError(result);
|
|
20844
|
+
await refetch();
|
|
20845
|
+
},
|
|
20846
|
+
[refetch]
|
|
20847
|
+
);
|
|
20848
|
+
const unlink = useCallback(async () => {
|
|
20849
|
+
const result = await getFluidGridsClient().mutate({ mutation: UnlinkWorkflowGitRepositoryDocument });
|
|
20850
|
+
throwIfResultError(result);
|
|
20851
|
+
await refetch();
|
|
20852
|
+
}, [refetch]);
|
|
20853
|
+
const push = useCallback(
|
|
20854
|
+
async (version) => {
|
|
20855
|
+
const result = await getFluidGridsClient().mutate({
|
|
20856
|
+
mutation: PushWorkflowToGitDocument,
|
|
20857
|
+
variables: { workflowKey, version }
|
|
20858
|
+
});
|
|
20859
|
+
throwIfResultError(result);
|
|
20860
|
+
const pushed = result.data?.pushWorkflowToGit;
|
|
20861
|
+
if (!pushed) throw new Error("The push returned no result");
|
|
20862
|
+
await refetch();
|
|
20863
|
+
return pushed;
|
|
20864
|
+
},
|
|
20865
|
+
[workflowKey, refetch]
|
|
20866
|
+
);
|
|
20867
|
+
const diff = useCallback(
|
|
20868
|
+
async (commitSha, version) => {
|
|
20869
|
+
const result = await getFluidGridsClient().query({
|
|
20870
|
+
query: WorkflowGitDiffDocument,
|
|
20871
|
+
variables: { workflowKey, commitSha, version },
|
|
20872
|
+
fetchPolicy: "network-only"
|
|
20873
|
+
});
|
|
20874
|
+
throwIfResultError(result);
|
|
20875
|
+
const view = result.data?.workflowGitDiff;
|
|
20876
|
+
if (!view) throw new Error("The diff returned no result");
|
|
20877
|
+
return view;
|
|
20878
|
+
},
|
|
20879
|
+
[workflowKey]
|
|
20880
|
+
);
|
|
20881
|
+
const restore = useCallback(
|
|
20882
|
+
async (commitSha) => {
|
|
20883
|
+
const result = await getFluidGridsClient().mutate({
|
|
20884
|
+
mutation: RestoreWorkflowFromGitDocument,
|
|
20885
|
+
variables: { input: { workflowKey, commitSha } }
|
|
20886
|
+
});
|
|
20887
|
+
throwIfResultError(result);
|
|
20888
|
+
const restored = result.data?.restoreWorkflowFromGit;
|
|
20889
|
+
if (!restored) throw new Error("The restore returned no result");
|
|
20890
|
+
return restored;
|
|
20891
|
+
},
|
|
20892
|
+
[workflowKey]
|
|
20893
|
+
);
|
|
20894
|
+
return {
|
|
20895
|
+
repository,
|
|
20896
|
+
commits,
|
|
20897
|
+
pushes,
|
|
20898
|
+
loading,
|
|
20899
|
+
error,
|
|
20900
|
+
historyError,
|
|
20901
|
+
refetch,
|
|
20902
|
+
link,
|
|
20903
|
+
unlink,
|
|
20904
|
+
push,
|
|
20905
|
+
diff,
|
|
20906
|
+
restore
|
|
20907
|
+
};
|
|
20908
|
+
}
|
|
20909
|
+
|
|
20910
|
+
// src/builder/lib/workflow-git-sync.ts
|
|
20911
|
+
var GITHUB_PROVIDER_KEY = "github";
|
|
20912
|
+
var DEFAULT_GIT_BRANCH = "main";
|
|
20913
|
+
var DEFAULT_GIT_FOLDER = "fluidgrids/workflows";
|
|
20914
|
+
function githubConnections(connections) {
|
|
20915
|
+
return connections.filter(
|
|
20916
|
+
(connection) => connection.provider?.key?.toLowerCase() === GITHUB_PROVIDER_KEY
|
|
20917
|
+
).sort((a, b) => {
|
|
20918
|
+
const activeA = a.status === "ACTIVE" ? 0 : 1;
|
|
20919
|
+
const activeB = b.status === "ACTIVE" ? 0 : 1;
|
|
20920
|
+
return activeA - activeB || a.name.localeCompare(b.name);
|
|
20921
|
+
});
|
|
20922
|
+
}
|
|
20923
|
+
function normalizeRepositoryInput(value) {
|
|
20924
|
+
return value.trim().replace(/^https?:\/\/github\.com\//i, "").replace(/\.git$/i, "").replace(/\/+$/, "");
|
|
20925
|
+
}
|
|
20926
|
+
function gitLinkFormProblem(form) {
|
|
20927
|
+
if (!form.connectionId.trim()) return "connection";
|
|
20928
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9-]*\/[A-Za-z0-9._-]+$/.test(
|
|
20929
|
+
normalizeRepositoryInput(form.repository)
|
|
20930
|
+
))
|
|
20931
|
+
return "repository";
|
|
20932
|
+
const branch = form.branch.trim();
|
|
20933
|
+
if (!branch || /\s|\.\.|^\/|\/$/.test(branch)) return "branch";
|
|
20934
|
+
const folder = form.pathPrefix.trim().replace(/^\/+|\/+$/g, "");
|
|
20935
|
+
if (folder.split("/").some((segment) => segment === ".." || segment === "."))
|
|
20936
|
+
return "pathPrefix";
|
|
20937
|
+
return null;
|
|
20938
|
+
}
|
|
20939
|
+
function gitFilePath(pathPrefix, workflowKey) {
|
|
20940
|
+
return pathPrefix ? `${pathPrefix}/${workflowKey}.json` : `${workflowKey}.json`;
|
|
20941
|
+
}
|
|
20942
|
+
function shortSha(sha) {
|
|
20943
|
+
return sha ? sha.slice(0, 7) : "";
|
|
20944
|
+
}
|
|
20945
|
+
function commitTitle(message) {
|
|
20946
|
+
const first = message.split("\n", 1)[0] ?? "";
|
|
20947
|
+
return first.trim() || "(no message)";
|
|
20948
|
+
}
|
|
20949
|
+
var EMPTY_FORM = {
|
|
20950
|
+
connectionId: "",
|
|
20951
|
+
repository: "",
|
|
20952
|
+
branch: DEFAULT_GIT_BRANCH,
|
|
20953
|
+
pathPrefix: DEFAULT_GIT_FOLDER,
|
|
20954
|
+
pushOnActivation: true,
|
|
20955
|
+
pushOnPromotion: true
|
|
20956
|
+
};
|
|
20957
|
+
function formatDiffValue2(value) {
|
|
20958
|
+
if (value === void 0 || value === null) return "\u2014";
|
|
20959
|
+
try {
|
|
20960
|
+
return JSON.stringify(value);
|
|
20961
|
+
} catch {
|
|
20962
|
+
return String(value);
|
|
20963
|
+
}
|
|
20964
|
+
}
|
|
20965
|
+
function GitSyncPanel({
|
|
20966
|
+
className,
|
|
20967
|
+
compact = false
|
|
20968
|
+
}) {
|
|
20969
|
+
const tr = useTr();
|
|
20970
|
+
const navigate = useNavigate();
|
|
20971
|
+
const params = useParams();
|
|
20972
|
+
const workflowKey = params?.id ?? "";
|
|
20973
|
+
const currentVersion = params?.version ?? "";
|
|
20974
|
+
const {
|
|
20975
|
+
repository,
|
|
20976
|
+
commits,
|
|
20977
|
+
pushes,
|
|
20978
|
+
loading,
|
|
20979
|
+
error,
|
|
20980
|
+
historyError,
|
|
20981
|
+
refetch,
|
|
20982
|
+
link,
|
|
20983
|
+
unlink,
|
|
20984
|
+
push,
|
|
20985
|
+
diff,
|
|
20986
|
+
restore
|
|
20987
|
+
} = useWorkflowGitSync(workflowKey);
|
|
20988
|
+
const {
|
|
20989
|
+
connections,
|
|
20990
|
+
loading: connectionsLoading,
|
|
20991
|
+
refetch: refetchConnections
|
|
20992
|
+
} = useConnections();
|
|
20993
|
+
const gitConnections = useMemo(
|
|
20994
|
+
() => githubConnections(connections),
|
|
20995
|
+
[connections]
|
|
20996
|
+
);
|
|
20997
|
+
const [busy, setBusy] = useState(null);
|
|
20998
|
+
const [editing, setEditing] = useState(false);
|
|
20999
|
+
const [form, setForm] = useState(EMPTY_FORM);
|
|
21000
|
+
const [showProblem, setShowProblem] = useState(false);
|
|
21001
|
+
const [newConnectionOpen, setNewConnectionOpen] = useState(false);
|
|
21002
|
+
const [comparison, setComparison] = useState(
|
|
21003
|
+
null
|
|
21004
|
+
);
|
|
21005
|
+
const [confirm, setConfirm] = useState(null);
|
|
21006
|
+
const config = getFluidGridsConfig();
|
|
21007
|
+
const actorInputs = useMemo(() => {
|
|
21008
|
+
const ids = /* @__PURE__ */ new Set();
|
|
21009
|
+
for (const item of pushes) ids.add(item.pushedById);
|
|
21010
|
+
if (repository) ids.add(repository.linkedById);
|
|
21011
|
+
return [...ids].map((actorId) => ({ actorId, actorType: "user" }));
|
|
21012
|
+
}, [pushes, repository]);
|
|
21013
|
+
const actorProfiles = useActorProfiles(actorInputs, {
|
|
21014
|
+
workspaceId: config.workspaceId || void 0,
|
|
21015
|
+
orgId: config.organizationId,
|
|
21016
|
+
authToken: config.authToken
|
|
21017
|
+
});
|
|
21018
|
+
const nameOf = (actorId) => {
|
|
21019
|
+
if (!actorId) return null;
|
|
21020
|
+
return actorProfiles[actorId]?.displayName ?? buildActorFallback({ actorId, actorType: "user" }).displayName;
|
|
21021
|
+
};
|
|
21022
|
+
const problem = gitLinkFormProblem(form);
|
|
21023
|
+
const problemText = (value) => {
|
|
21024
|
+
switch (value) {
|
|
21025
|
+
case "connection":
|
|
21026
|
+
return tr(
|
|
21027
|
+
"fluidgrids.builder.git.problemConnection",
|
|
21028
|
+
"Choose a GitHub connection"
|
|
21029
|
+
);
|
|
21030
|
+
case "repository":
|
|
21031
|
+
return tr(
|
|
21032
|
+
"fluidgrids.builder.git.problemRepository",
|
|
21033
|
+
"Enter the repository as owner/name"
|
|
21034
|
+
);
|
|
21035
|
+
case "branch":
|
|
21036
|
+
return tr(
|
|
21037
|
+
"fluidgrids.builder.git.problemBranch",
|
|
21038
|
+
"Enter a valid branch name"
|
|
21039
|
+
);
|
|
21040
|
+
default:
|
|
21041
|
+
return tr(
|
|
21042
|
+
"fluidgrids.builder.git.problemFolder",
|
|
21043
|
+
"The folder cannot contain . or .. segments"
|
|
21044
|
+
);
|
|
21045
|
+
}
|
|
21046
|
+
};
|
|
21047
|
+
const run = async (key, action, errorTitle) => {
|
|
21048
|
+
setBusy(key);
|
|
21049
|
+
try {
|
|
21050
|
+
await action();
|
|
21051
|
+
} catch (err) {
|
|
21052
|
+
toast.error(errorTitle, {
|
|
21053
|
+
description: err instanceof Error ? err.message : String(err)
|
|
21054
|
+
});
|
|
21055
|
+
} finally {
|
|
21056
|
+
setBusy(null);
|
|
21057
|
+
}
|
|
21058
|
+
};
|
|
21059
|
+
const startEditing = () => {
|
|
21060
|
+
setForm(
|
|
21061
|
+
repository ? {
|
|
21062
|
+
connectionId: repository.connectionId,
|
|
21063
|
+
repository: repository.repository,
|
|
21064
|
+
branch: repository.branch,
|
|
21065
|
+
pathPrefix: repository.pathPrefix,
|
|
21066
|
+
pushOnActivation: repository.pushOnActivation,
|
|
21067
|
+
pushOnPromotion: repository.pushOnPromotion
|
|
21068
|
+
} : {
|
|
21069
|
+
...EMPTY_FORM,
|
|
21070
|
+
connectionId: gitConnections[0]?.id ?? ""
|
|
21071
|
+
}
|
|
21072
|
+
);
|
|
21073
|
+
setShowProblem(false);
|
|
21074
|
+
setEditing(true);
|
|
21075
|
+
};
|
|
21076
|
+
const handleLink = () => {
|
|
21077
|
+
if (problem) {
|
|
21078
|
+
setShowProblem(true);
|
|
21079
|
+
return;
|
|
21080
|
+
}
|
|
21081
|
+
void run(
|
|
21082
|
+
"link",
|
|
21083
|
+
async () => {
|
|
21084
|
+
await link(form);
|
|
21085
|
+
setEditing(false);
|
|
21086
|
+
toast.success(
|
|
21087
|
+
tr("fluidgrids.builder.git.linked", "Repository linked"),
|
|
21088
|
+
{
|
|
21089
|
+
description: `${form.repository.trim()} @ ${form.branch.trim()}`,
|
|
21090
|
+
dismissible: true
|
|
21091
|
+
}
|
|
21092
|
+
);
|
|
21093
|
+
},
|
|
21094
|
+
tr("fluidgrids.builder.git.linkError", "Could not link the repository")
|
|
21095
|
+
);
|
|
21096
|
+
};
|
|
21097
|
+
const handlePush = () => run(
|
|
21098
|
+
"push",
|
|
21099
|
+
async () => {
|
|
21100
|
+
const pushed = await push(currentVersion);
|
|
21101
|
+
toast.success(
|
|
21102
|
+
pushed.status === "UNCHANGED" ? tr(
|
|
21103
|
+
"fluidgrids.builder.git.unchanged",
|
|
21104
|
+
"Already up to date in Git"
|
|
21105
|
+
) : `${pushed.version} ${tr("fluidgrids.builder.git.pushed", "pushed to Git")}`,
|
|
21106
|
+
{
|
|
21107
|
+
description: pushed.commitSha ? `${pushed.filePath} \xB7 ${shortSha(pushed.commitSha)}` : pushed.filePath,
|
|
21108
|
+
dismissible: true
|
|
21109
|
+
}
|
|
21110
|
+
);
|
|
21111
|
+
},
|
|
21112
|
+
tr("fluidgrids.builder.git.pushError", "Push to Git failed")
|
|
21113
|
+
);
|
|
21114
|
+
const handleCompare = (sha) => run(
|
|
21115
|
+
`diff:${sha}`,
|
|
21116
|
+
async () => {
|
|
21117
|
+
setComparison(await diff(sha, currentVersion));
|
|
21118
|
+
},
|
|
21119
|
+
tr("fluidgrids.builder.git.diffError", "Could not compare")
|
|
21120
|
+
);
|
|
21121
|
+
const handleConfirm = async () => {
|
|
21122
|
+
if (!confirm) return;
|
|
21123
|
+
const current = confirm;
|
|
21124
|
+
setConfirm(null);
|
|
21125
|
+
if (current.kind === "unlink") {
|
|
21126
|
+
await run(
|
|
21127
|
+
"unlink",
|
|
21128
|
+
async () => {
|
|
21129
|
+
await unlink();
|
|
21130
|
+
setComparison(null);
|
|
21131
|
+
toast.success(
|
|
21132
|
+
tr("fluidgrids.builder.git.unlinked", "Repository unlinked"),
|
|
21133
|
+
{ dismissible: true }
|
|
21134
|
+
);
|
|
21135
|
+
},
|
|
21136
|
+
tr(
|
|
21137
|
+
"fluidgrids.builder.git.unlinkError",
|
|
21138
|
+
"Could not unlink the repository"
|
|
21139
|
+
)
|
|
21140
|
+
);
|
|
21141
|
+
return;
|
|
21142
|
+
}
|
|
21143
|
+
await run(
|
|
21144
|
+
`restore:${current.sha}`,
|
|
21145
|
+
async () => {
|
|
21146
|
+
const result = await restore(current.sha);
|
|
21147
|
+
if (!result.success || !result.workflow) {
|
|
21148
|
+
const reasons = [
|
|
21149
|
+
...result.validation?.errors ?? [],
|
|
21150
|
+
result.message ?? ""
|
|
21151
|
+
].filter(Boolean);
|
|
21152
|
+
throw new Error(reasons.join(" "));
|
|
21153
|
+
}
|
|
21154
|
+
toast.success(
|
|
21155
|
+
tr("fluidgrids.builder.git.restored", "Restored from Git"),
|
|
21156
|
+
{
|
|
21157
|
+
description: `${shortSha(current.sha)} \u2192 ${result.workflow.version}`,
|
|
21158
|
+
dismissible: true
|
|
21159
|
+
}
|
|
21160
|
+
);
|
|
21161
|
+
navigate(
|
|
21162
|
+
`../workflow/${result.workflow.workflowKey}/${result.workflow.version}`
|
|
21163
|
+
);
|
|
21164
|
+
},
|
|
21165
|
+
tr("fluidgrids.builder.git.restoreError", "Restore from Git failed")
|
|
21166
|
+
);
|
|
21167
|
+
};
|
|
21168
|
+
const pushStatusVariant = (status) => {
|
|
21169
|
+
if (status === "PUSHED") return "default";
|
|
21170
|
+
if (status === "FAILED") return "destructive";
|
|
21171
|
+
return "outline";
|
|
21172
|
+
};
|
|
21173
|
+
const triggerLabel = (trigger) => {
|
|
21174
|
+
if (trigger === "PROMOTION")
|
|
21175
|
+
return tr("fluidgrids.builder.git.triggerPromotion", "Promotion");
|
|
21176
|
+
if (trigger === "ACTIVATION")
|
|
21177
|
+
return tr("fluidgrids.builder.git.triggerActivation", "Publish");
|
|
21178
|
+
return tr("fluidgrids.builder.git.triggerManual", "Manual");
|
|
21179
|
+
};
|
|
21180
|
+
const linkForm = /* @__PURE__ */ jsxs(
|
|
21181
|
+
"div",
|
|
21182
|
+
{
|
|
21183
|
+
className: "space-y-3 rounded-lg border border-border p-3",
|
|
21184
|
+
"data-testid": "fluidgrids-git-link-form",
|
|
21185
|
+
children: [
|
|
21186
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
21187
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "fg-git-connection", className: "text-xs", children: tr("fluidgrids.builder.git.connection", "GitHub connection") }),
|
|
21188
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
21189
|
+
/* @__PURE__ */ jsxs(
|
|
21190
|
+
Select,
|
|
21191
|
+
{
|
|
21192
|
+
value: form.connectionId,
|
|
21193
|
+
onValueChange: (value) => setForm((prev) => ({ ...prev, connectionId: value })),
|
|
21194
|
+
children: [
|
|
21195
|
+
/* @__PURE__ */ jsx(SelectTrigger, { id: "fg-git-connection", className: "h-8 flex-1", children: /* @__PURE__ */ jsx(
|
|
21196
|
+
SelectValue,
|
|
21197
|
+
{
|
|
21198
|
+
placeholder: connectionsLoading ? tr("fluidgrids.builder.git.loading", "Loading...") : tr(
|
|
21199
|
+
"fluidgrids.builder.git.chooseConnection",
|
|
21200
|
+
"Choose a connection"
|
|
21201
|
+
)
|
|
21202
|
+
}
|
|
21203
|
+
) }),
|
|
21204
|
+
/* @__PURE__ */ jsx(SelectContent, { className: "z-[120]", children: gitConnections.map((connection) => /* @__PURE__ */ jsxs(SelectItem, { value: connection.id, children: [
|
|
21205
|
+
connection.name,
|
|
21206
|
+
connection.status !== "ACTIVE" ? ` (${connection.status.toLowerCase()})` : ""
|
|
21207
|
+
] }, connection.id)) })
|
|
21208
|
+
]
|
|
21209
|
+
}
|
|
21210
|
+
),
|
|
21211
|
+
/* @__PURE__ */ jsxs(
|
|
21212
|
+
Button$1,
|
|
21213
|
+
{
|
|
21214
|
+
variant: "outline",
|
|
21215
|
+
size: "sm",
|
|
21216
|
+
className: "h-8 gap-1 text-xs",
|
|
21217
|
+
onClick: () => setNewConnectionOpen(true),
|
|
21218
|
+
children: [
|
|
21219
|
+
/* @__PURE__ */ jsx(Plus, { className: "size-3.5" }),
|
|
21220
|
+
tr("fluidgrids.builder.git.newConnection", "New")
|
|
21221
|
+
]
|
|
21222
|
+
}
|
|
21223
|
+
)
|
|
21224
|
+
] }),
|
|
21225
|
+
!connectionsLoading && gitConnections.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-[11px] text-muted-foreground", children: tr(
|
|
21226
|
+
"fluidgrids.builder.git.noConnections",
|
|
21227
|
+
"No GitHub connection yet. Create one; it needs access to the repository's contents (the repo scope)."
|
|
21228
|
+
) })
|
|
21229
|
+
] }),
|
|
21230
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
21231
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "fg-git-repository", className: "text-xs", children: tr("fluidgrids.builder.git.repository", "Repository") }),
|
|
21232
|
+
/* @__PURE__ */ jsx(
|
|
21233
|
+
Input,
|
|
21234
|
+
{
|
|
21235
|
+
id: "fg-git-repository",
|
|
21236
|
+
className: "h-8 font-mono text-xs",
|
|
21237
|
+
placeholder: "owner/name",
|
|
21238
|
+
value: form.repository,
|
|
21239
|
+
onChange: (event) => setForm((prev) => ({ ...prev, repository: event.target.value }))
|
|
21240
|
+
}
|
|
21241
|
+
)
|
|
21242
|
+
] }),
|
|
21243
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
21244
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
21245
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "fg-git-branch", className: "text-xs", children: tr("fluidgrids.builder.git.branch", "Branch") }),
|
|
21246
|
+
/* @__PURE__ */ jsx(
|
|
21247
|
+
Input,
|
|
21248
|
+
{
|
|
21249
|
+
id: "fg-git-branch",
|
|
21250
|
+
className: "h-8 font-mono text-xs",
|
|
21251
|
+
value: form.branch,
|
|
21252
|
+
onChange: (event) => setForm((prev) => ({ ...prev, branch: event.target.value }))
|
|
21253
|
+
}
|
|
21254
|
+
)
|
|
21255
|
+
] }),
|
|
21256
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
21257
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "fg-git-folder", className: "text-xs", children: tr("fluidgrids.builder.git.folder", "Folder") }),
|
|
21258
|
+
/* @__PURE__ */ jsx(
|
|
21259
|
+
Input,
|
|
21260
|
+
{
|
|
21261
|
+
id: "fg-git-folder",
|
|
21262
|
+
className: "h-8 font-mono text-xs",
|
|
21263
|
+
value: form.pathPrefix,
|
|
21264
|
+
onChange: (event) => setForm((prev) => ({ ...prev, pathPrefix: event.target.value }))
|
|
21265
|
+
}
|
|
21266
|
+
)
|
|
21267
|
+
] })
|
|
21268
|
+
] }),
|
|
21269
|
+
[
|
|
21270
|
+
[
|
|
21271
|
+
"pushOnActivation",
|
|
21272
|
+
tr(
|
|
21273
|
+
"fluidgrids.builder.git.pushOnActivation",
|
|
21274
|
+
"Commit when a version is published"
|
|
21275
|
+
)
|
|
21276
|
+
],
|
|
21277
|
+
[
|
|
21278
|
+
"pushOnPromotion",
|
|
21279
|
+
tr(
|
|
21280
|
+
"fluidgrids.builder.git.pushOnPromotion",
|
|
21281
|
+
"Commit when a promotion applies"
|
|
21282
|
+
)
|
|
21283
|
+
]
|
|
21284
|
+
].map(([field, label]) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
21285
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: `fg-git-${field}`, className: "text-xs font-normal", children: label }),
|
|
21286
|
+
/* @__PURE__ */ jsx(
|
|
21287
|
+
Switch,
|
|
21288
|
+
{
|
|
21289
|
+
id: `fg-git-${field}`,
|
|
21290
|
+
checked: form[field],
|
|
21291
|
+
onCheckedChange: (checked) => setForm((prev) => ({ ...prev, [field]: checked }))
|
|
21292
|
+
}
|
|
21293
|
+
)
|
|
21294
|
+
] }, field)),
|
|
21295
|
+
showProblem && problem && /* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--color-status-error-text)]", children: problemText(problem) }),
|
|
21296
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2", children: [
|
|
21297
|
+
/* @__PURE__ */ jsxs(
|
|
21298
|
+
Button$1,
|
|
21299
|
+
{
|
|
21300
|
+
size: "sm",
|
|
21301
|
+
className: "h-7 gap-1 text-xs",
|
|
21302
|
+
disabled: busy !== null,
|
|
21303
|
+
onClick: handleLink,
|
|
21304
|
+
children: [
|
|
21305
|
+
busy === "link" ? /* @__PURE__ */ jsx(Loader2, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ jsx(Link2, { className: "size-3.5" }),
|
|
21306
|
+
repository ? tr("fluidgrids.builder.git.saveLink", "Save") : tr("fluidgrids.builder.git.link", "Link repository")
|
|
21307
|
+
]
|
|
21308
|
+
}
|
|
21309
|
+
),
|
|
21310
|
+
repository && /* @__PURE__ */ jsx(
|
|
21311
|
+
Button$1,
|
|
21312
|
+
{
|
|
21313
|
+
size: "sm",
|
|
21314
|
+
variant: "ghost",
|
|
21315
|
+
className: "h-7 text-xs",
|
|
21316
|
+
disabled: busy !== null,
|
|
21317
|
+
onClick: () => setEditing(false),
|
|
21318
|
+
children: tr("fluidgrids.builder.git.cancel", "Cancel")
|
|
21319
|
+
}
|
|
21320
|
+
)
|
|
21321
|
+
] }),
|
|
21322
|
+
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-muted-foreground", children: tr(
|
|
21323
|
+
"fluidgrids.builder.git.linkHint",
|
|
21324
|
+
"The link applies to every workflow in this workspace. Linking checks that the connection can read the branch. Only members with publish rights can change it."
|
|
21325
|
+
) })
|
|
21326
|
+
]
|
|
21327
|
+
}
|
|
21328
|
+
);
|
|
21329
|
+
return /* @__PURE__ */ jsxs(
|
|
21330
|
+
Sheet,
|
|
21331
|
+
{
|
|
21332
|
+
onOpenChange: (open) => {
|
|
21333
|
+
if (!open) return;
|
|
21334
|
+
setComparison(null);
|
|
21335
|
+
void refetch();
|
|
21336
|
+
void refetchConnections();
|
|
21337
|
+
},
|
|
21338
|
+
children: [
|
|
21339
|
+
/* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
21340
|
+
Button$1,
|
|
21341
|
+
{
|
|
21342
|
+
"data-tour": "fluidgrids-builder-git",
|
|
21343
|
+
variant: "outline",
|
|
21344
|
+
size: compact ? "icon" : "sm",
|
|
21345
|
+
className: cn$1(!compact && "flex gap-1", className),
|
|
21346
|
+
"aria-label": tr("fluidgrids.builder.git.triggerButton", "Git"),
|
|
21347
|
+
disabled: !workflowKey,
|
|
21348
|
+
children: [
|
|
21349
|
+
/* @__PURE__ */ jsx(GitBranch, { className: "size-4" }),
|
|
21350
|
+
!compact && tr("fluidgrids.builder.git.triggerButton", "Git")
|
|
21351
|
+
]
|
|
21352
|
+
}
|
|
21353
|
+
) }),
|
|
21354
|
+
/* @__PURE__ */ jsxs(
|
|
21355
|
+
SheetContent,
|
|
21356
|
+
{
|
|
21357
|
+
side: "right",
|
|
21358
|
+
className: "w-[380px] sm:w-[460px] overflow-y-auto",
|
|
21359
|
+
"data-testid": "fluidgrids-git-panel",
|
|
21360
|
+
children: [
|
|
21361
|
+
/* @__PURE__ */ jsxs(SheetHeader, { children: [
|
|
21362
|
+
/* @__PURE__ */ jsxs(SheetTitle, { className: "flex items-center gap-2", children: [
|
|
21363
|
+
/* @__PURE__ */ jsx(GitBranch, { className: "size-5" }),
|
|
21364
|
+
tr("fluidgrids.builder.git.title", "Git sync")
|
|
21365
|
+
] }),
|
|
21366
|
+
/* @__PURE__ */ jsx(SheetDescription, { children: tr(
|
|
21367
|
+
"fluidgrids.builder.git.description",
|
|
21368
|
+
"Keep this workflow in a GitHub repository: commit versions, read the file's history, compare a commit with this version or restore it as a new draft."
|
|
21369
|
+
) })
|
|
21370
|
+
] }),
|
|
21371
|
+
loading && !repository && pushes.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center py-8 text-sm text-muted-foreground", children: [
|
|
21372
|
+
/* @__PURE__ */ jsx(Loader2, { className: "mr-2 size-4 animate-spin" }),
|
|
21373
|
+
tr("fluidgrids.builder.git.loading", "Loading...")
|
|
21374
|
+
] }) : error ? /* @__PURE__ */ jsxs("div", { className: "py-6 text-sm", children: [
|
|
21375
|
+
/* @__PURE__ */ jsx("p", { className: "text-[var(--color-status-error-text)]", children: error }),
|
|
21376
|
+
/* @__PURE__ */ jsx(
|
|
21377
|
+
Button$1,
|
|
21378
|
+
{
|
|
21379
|
+
variant: "outline",
|
|
21380
|
+
size: "sm",
|
|
21381
|
+
className: "mt-3",
|
|
21382
|
+
onClick: () => void refetch(),
|
|
21383
|
+
children: tr("fluidgrids.builder.git.retry", "Retry")
|
|
21384
|
+
}
|
|
21385
|
+
)
|
|
21386
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "mt-4 space-y-5 pb-6", children: [
|
|
21387
|
+
/* @__PURE__ */ jsxs("section", { "aria-labelledby": "fg-git-repo", children: [
|
|
21388
|
+
/* @__PURE__ */ jsx(
|
|
21389
|
+
"h3",
|
|
21390
|
+
{
|
|
21391
|
+
id: "fg-git-repo",
|
|
21392
|
+
className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
21393
|
+
children: tr("fluidgrids.builder.git.repositoryTitle", "Repository")
|
|
21394
|
+
}
|
|
21395
|
+
),
|
|
21396
|
+
!repository && !editing ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-dashed border-border p-3", children: [
|
|
21397
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: tr(
|
|
21398
|
+
"fluidgrids.builder.git.notLinked",
|
|
21399
|
+
"No repository is linked to this workspace yet."
|
|
21400
|
+
) }),
|
|
21401
|
+
/* @__PURE__ */ jsxs(
|
|
21402
|
+
Button$1,
|
|
21403
|
+
{
|
|
21404
|
+
size: "sm",
|
|
21405
|
+
className: "mt-2 h-7 gap-1 text-xs",
|
|
21406
|
+
onClick: startEditing,
|
|
21407
|
+
children: [
|
|
21408
|
+
/* @__PURE__ */ jsx(Link2, { className: "size-3.5" }),
|
|
21409
|
+
tr("fluidgrids.builder.git.link", "Link repository")
|
|
21410
|
+
]
|
|
21411
|
+
}
|
|
21412
|
+
)
|
|
21413
|
+
] }) : editing ? linkForm : repository ? /* @__PURE__ */ jsxs(
|
|
21414
|
+
"div",
|
|
21415
|
+
{
|
|
21416
|
+
className: "rounded-lg border border-border p-3",
|
|
21417
|
+
"data-testid": "fluidgrids-git-linked",
|
|
21418
|
+
children: [
|
|
21419
|
+
/* @__PURE__ */ jsx("p", { className: "font-mono text-sm text-foreground", children: repository.repository }),
|
|
21420
|
+
/* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: [
|
|
21421
|
+
`${tr("fluidgrids.builder.git.branch", "Branch")} ${repository.branch}`,
|
|
21422
|
+
gitFilePath(repository.pathPrefix, workflowKey)
|
|
21423
|
+
].join(" \xB7 ") }),
|
|
21424
|
+
/* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: [
|
|
21425
|
+
repository.pushOnActivation ? tr(
|
|
21426
|
+
"fluidgrids.builder.git.onPublish",
|
|
21427
|
+
"Commits on publish"
|
|
21428
|
+
) : null,
|
|
21429
|
+
repository.pushOnPromotion ? tr(
|
|
21430
|
+
"fluidgrids.builder.git.onPromotion",
|
|
21431
|
+
"Commits on promotion"
|
|
21432
|
+
) : null,
|
|
21433
|
+
nameOf(repository.linkedById)
|
|
21434
|
+
].filter(Boolean).join(" \xB7 ") }),
|
|
21435
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-2 flex flex-wrap gap-2", children: [
|
|
21436
|
+
currentVersion && /* @__PURE__ */ jsxs(
|
|
21437
|
+
Button$1,
|
|
21438
|
+
{
|
|
21439
|
+
size: "sm",
|
|
21440
|
+
className: "h-7 gap-1 text-xs",
|
|
21441
|
+
disabled: busy !== null,
|
|
21442
|
+
onClick: () => void handlePush(),
|
|
21443
|
+
children: [
|
|
21444
|
+
busy === "push" ? /* @__PURE__ */ jsx(Loader2, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ jsx(Upload, { className: "size-3.5" }),
|
|
21445
|
+
tr("fluidgrids.builder.git.push", "Push"),
|
|
21446
|
+
" ",
|
|
21447
|
+
currentVersion
|
|
21448
|
+
]
|
|
21449
|
+
}
|
|
21450
|
+
),
|
|
21451
|
+
/* @__PURE__ */ jsx(
|
|
21452
|
+
Button$1,
|
|
21453
|
+
{
|
|
21454
|
+
size: "sm",
|
|
21455
|
+
variant: "outline",
|
|
21456
|
+
className: "h-7 text-xs",
|
|
21457
|
+
disabled: busy !== null,
|
|
21458
|
+
onClick: startEditing,
|
|
21459
|
+
children: tr("fluidgrids.builder.git.edit", "Edit link")
|
|
21460
|
+
}
|
|
21461
|
+
),
|
|
21462
|
+
/* @__PURE__ */ jsxs(
|
|
21463
|
+
Button$1,
|
|
21464
|
+
{
|
|
21465
|
+
size: "sm",
|
|
21466
|
+
variant: "ghost",
|
|
21467
|
+
className: "h-7 gap-1 text-xs",
|
|
21468
|
+
disabled: busy !== null,
|
|
21469
|
+
onClick: () => setConfirm({ kind: "unlink" }),
|
|
21470
|
+
children: [
|
|
21471
|
+
/* @__PURE__ */ jsx(Unlink, { className: "size-3.5" }),
|
|
21472
|
+
tr("fluidgrids.builder.git.unlink", "Unlink")
|
|
21473
|
+
]
|
|
21474
|
+
}
|
|
21475
|
+
)
|
|
21476
|
+
] })
|
|
21477
|
+
]
|
|
21478
|
+
}
|
|
21479
|
+
) : null
|
|
21480
|
+
] }),
|
|
21481
|
+
repository && /* @__PURE__ */ jsxs("section", { "aria-labelledby": "fg-git-commits", children: [
|
|
21482
|
+
/* @__PURE__ */ jsx(
|
|
21483
|
+
"h3",
|
|
21484
|
+
{
|
|
21485
|
+
id: "fg-git-commits",
|
|
21486
|
+
className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
21487
|
+
children: tr("fluidgrids.builder.git.commitsTitle", "Git history")
|
|
21488
|
+
}
|
|
21489
|
+
),
|
|
21490
|
+
historyError ? /* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--color-status-error-text)]", children: historyError }) : commits.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: tr(
|
|
21491
|
+
"fluidgrids.builder.git.commitsEmpty",
|
|
21492
|
+
"This workflow has no commits in the repository yet."
|
|
21493
|
+
) }) : /* @__PURE__ */ jsx("ul", { className: "space-y-2", children: commits.map((commit) => /* @__PURE__ */ jsxs(
|
|
21494
|
+
"li",
|
|
21495
|
+
{
|
|
21496
|
+
className: "rounded-lg border border-border p-2.5",
|
|
21497
|
+
"data-testid": "fluidgrids-git-commit",
|
|
21498
|
+
children: [
|
|
21499
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
|
|
21500
|
+
/* @__PURE__ */ jsx("p", { className: "min-w-0 truncate text-xs font-medium text-foreground", children: commitTitle(commit.message) }),
|
|
21501
|
+
commit.version && /* @__PURE__ */ jsx(
|
|
21502
|
+
Badge,
|
|
21503
|
+
{
|
|
21504
|
+
variant: "outline",
|
|
21505
|
+
className: "h-5 shrink-0 px-1.5 py-0 font-mono text-[10px]",
|
|
21506
|
+
children: commit.version
|
|
21507
|
+
}
|
|
21508
|
+
)
|
|
21509
|
+
] }),
|
|
21510
|
+
/* @__PURE__ */ jsx("p", { className: "mt-0.5 text-[11px] text-muted-foreground", children: [
|
|
21511
|
+
shortSha(commit.sha),
|
|
21512
|
+
commit.authorName,
|
|
21513
|
+
relativeTime(commit.authoredAt)
|
|
21514
|
+
].filter(Boolean).join(" \xB7 ") }),
|
|
21515
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-1.5 flex flex-wrap gap-1.5", children: [
|
|
21516
|
+
currentVersion && /* @__PURE__ */ jsxs(
|
|
21517
|
+
Button$1,
|
|
21518
|
+
{
|
|
21519
|
+
size: "sm",
|
|
21520
|
+
variant: "outline",
|
|
21521
|
+
className: "h-6 gap-1 px-2 text-[11px]",
|
|
21522
|
+
disabled: busy !== null,
|
|
21523
|
+
onClick: () => void handleCompare(commit.sha),
|
|
21524
|
+
children: [
|
|
21525
|
+
busy === `diff:${commit.sha}` ? /* @__PURE__ */ jsx(Loader2, { className: "size-3 animate-spin" }) : /* @__PURE__ */ jsx(GitCompare, { className: "size-3" }),
|
|
21526
|
+
tr(
|
|
21527
|
+
"fluidgrids.builder.git.compare",
|
|
21528
|
+
"Compare with"
|
|
21529
|
+
),
|
|
21530
|
+
" ",
|
|
21531
|
+
currentVersion
|
|
21532
|
+
]
|
|
21533
|
+
}
|
|
21534
|
+
),
|
|
21535
|
+
/* @__PURE__ */ jsxs(
|
|
21536
|
+
Button$1,
|
|
21537
|
+
{
|
|
21538
|
+
size: "sm",
|
|
21539
|
+
variant: "outline",
|
|
21540
|
+
className: "h-6 gap-1 px-2 text-[11px]",
|
|
21541
|
+
disabled: busy !== null,
|
|
21542
|
+
onClick: () => setConfirm({ kind: "restore", sha: commit.sha }),
|
|
21543
|
+
children: [
|
|
21544
|
+
busy === `restore:${commit.sha}` ? /* @__PURE__ */ jsx(Loader2, { className: "size-3 animate-spin" }) : /* @__PURE__ */ jsx(RotateCcw, { className: "size-3" }),
|
|
21545
|
+
tr(
|
|
21546
|
+
"fluidgrids.builder.git.restore",
|
|
21547
|
+
"Restore as draft"
|
|
21548
|
+
)
|
|
21549
|
+
]
|
|
21550
|
+
}
|
|
21551
|
+
),
|
|
21552
|
+
commit.url && /* @__PURE__ */ jsx(
|
|
21553
|
+
Button$1,
|
|
21554
|
+
{
|
|
21555
|
+
asChild: true,
|
|
21556
|
+
size: "sm",
|
|
21557
|
+
variant: "ghost",
|
|
21558
|
+
className: "h-6 gap-1 px-2 text-[11px]",
|
|
21559
|
+
children: /* @__PURE__ */ jsxs(
|
|
21560
|
+
"a",
|
|
21561
|
+
{
|
|
21562
|
+
href: commit.url,
|
|
21563
|
+
target: "_blank",
|
|
21564
|
+
rel: "noopener noreferrer",
|
|
21565
|
+
children: [
|
|
21566
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "size-3" }),
|
|
21567
|
+
tr(
|
|
21568
|
+
"fluidgrids.builder.git.openCommit",
|
|
21569
|
+
"Open"
|
|
21570
|
+
)
|
|
21571
|
+
]
|
|
21572
|
+
}
|
|
21573
|
+
)
|
|
21574
|
+
}
|
|
21575
|
+
)
|
|
21576
|
+
] })
|
|
21577
|
+
]
|
|
21578
|
+
},
|
|
21579
|
+
commit.sha
|
|
21580
|
+
)) }),
|
|
21581
|
+
comparison && /* @__PURE__ */ jsxs(
|
|
21582
|
+
"div",
|
|
21583
|
+
{
|
|
21584
|
+
className: "mt-3 space-y-2 border-t border-border pt-3",
|
|
21585
|
+
"data-testid": "fluidgrids-git-diff",
|
|
21586
|
+
children: [
|
|
21587
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
21588
|
+
shortSha(comparison.commitSha),
|
|
21589
|
+
" \u2192 ",
|
|
21590
|
+
comparison.version,
|
|
21591
|
+
":",
|
|
21592
|
+
" ",
|
|
21593
|
+
comparison.entries.length,
|
|
21594
|
+
" ",
|
|
21595
|
+
tr("fluidgrids.builder.git.changes", "changes"),
|
|
21596
|
+
comparison.truncated ? "+" : ""
|
|
21597
|
+
] }),
|
|
21598
|
+
comparison.entries.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: tr(
|
|
21599
|
+
"fluidgrids.builder.git.noChanges",
|
|
21600
|
+
"The commit matches this version"
|
|
21601
|
+
) }) : /* @__PURE__ */ jsx("ul", { className: "max-h-64 space-y-1 overflow-y-auto", children: comparison.entries.map((entry) => /* @__PURE__ */ jsxs(
|
|
21602
|
+
"li",
|
|
21603
|
+
{
|
|
21604
|
+
className: "rounded border border-border p-2 text-xs",
|
|
21605
|
+
children: [
|
|
21606
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
21607
|
+
/* @__PURE__ */ jsx(
|
|
21608
|
+
Badge,
|
|
21609
|
+
{
|
|
21610
|
+
variant: entry.kind === "CHANGED" ? "secondary" : entry.kind === "ADDED" ? "default" : "destructive",
|
|
21611
|
+
className: "text-[10px]",
|
|
21612
|
+
children: entry.kind
|
|
21613
|
+
}
|
|
21614
|
+
),
|
|
21615
|
+
/* @__PURE__ */ jsx("code", { className: "min-w-0 truncate font-mono", children: entry.path })
|
|
21616
|
+
] }),
|
|
21617
|
+
entry.kind === "CHANGED" && /* @__PURE__ */ jsxs("div", { className: "mt-1 grid gap-1 text-[11px] text-muted-foreground", children: [
|
|
21618
|
+
/* @__PURE__ */ jsxs("span", { className: "truncate", children: [
|
|
21619
|
+
"\u2212 ",
|
|
21620
|
+
formatDiffValue2(entry.before)
|
|
21621
|
+
] }),
|
|
21622
|
+
/* @__PURE__ */ jsxs("span", { className: "truncate", children: [
|
|
21623
|
+
"+ ",
|
|
21624
|
+
formatDiffValue2(entry.after)
|
|
21625
|
+
] })
|
|
21626
|
+
] })
|
|
21627
|
+
]
|
|
21628
|
+
},
|
|
21629
|
+
`${entry.kind}-${entry.path}`
|
|
21630
|
+
)) })
|
|
21631
|
+
]
|
|
21632
|
+
}
|
|
21633
|
+
)
|
|
21634
|
+
] }),
|
|
21635
|
+
/* @__PURE__ */ jsxs("section", { "aria-labelledby": "fg-git-pushes", children: [
|
|
21636
|
+
/* @__PURE__ */ jsx(
|
|
21637
|
+
"h3",
|
|
21638
|
+
{
|
|
21639
|
+
id: "fg-git-pushes",
|
|
21640
|
+
className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
21641
|
+
children: tr("fluidgrids.builder.git.pushesTitle", "Pushes")
|
|
21642
|
+
}
|
|
21643
|
+
),
|
|
21644
|
+
pushes.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: tr(
|
|
21645
|
+
"fluidgrids.builder.git.pushesEmpty",
|
|
21646
|
+
"Nothing was pushed from FluidGrids yet."
|
|
21647
|
+
) }) : /* @__PURE__ */ jsx("ul", { className: "space-y-1.5", children: pushes.map((item) => /* @__PURE__ */ jsxs(
|
|
21648
|
+
"li",
|
|
21649
|
+
{
|
|
21650
|
+
className: "flex items-start justify-between gap-2 text-xs",
|
|
21651
|
+
"data-testid": "fluidgrids-git-push",
|
|
21652
|
+
children: [
|
|
21653
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
21654
|
+
/* @__PURE__ */ jsxs("p", { className: "flex items-center gap-1 text-foreground", children: [
|
|
21655
|
+
/* @__PURE__ */ jsx(GitCommitHorizontal, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
21656
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono", children: item.version }),
|
|
21657
|
+
item.environment ? ` \u2192 ${item.environment}` : "",
|
|
21658
|
+
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
21659
|
+
"\xB7 ",
|
|
21660
|
+
triggerLabel(item.trigger)
|
|
21661
|
+
] })
|
|
21662
|
+
] }),
|
|
21663
|
+
/* @__PURE__ */ jsx("p", { className: "truncate text-muted-foreground", children: [
|
|
21664
|
+
shortSha(item.commitSha),
|
|
21665
|
+
nameOf(item.pushedById),
|
|
21666
|
+
relativeTime(item.pushedAt)
|
|
21667
|
+
].filter(Boolean).join(" \xB7 ") }),
|
|
21668
|
+
item.errorMessage && /* @__PURE__ */ jsx("p", { className: "text-[11px] text-[var(--color-status-error-text)]", children: item.errorMessage })
|
|
21669
|
+
] }),
|
|
21670
|
+
/* @__PURE__ */ jsx(
|
|
21671
|
+
Badge,
|
|
21672
|
+
{
|
|
21673
|
+
variant: pushStatusVariant(item.status),
|
|
21674
|
+
className: "h-5 shrink-0 px-1.5 py-0 text-[10px]",
|
|
21675
|
+
children: item.status === "PUSHED" ? tr("fluidgrids.builder.git.statusPushed", "Pushed") : item.status === "UNCHANGED" ? tr(
|
|
21676
|
+
"fluidgrids.builder.git.statusUnchanged",
|
|
21677
|
+
"Up to date"
|
|
21678
|
+
) : tr(
|
|
21679
|
+
"fluidgrids.builder.git.statusFailed",
|
|
21680
|
+
"Failed"
|
|
21681
|
+
)
|
|
21682
|
+
}
|
|
21683
|
+
)
|
|
21684
|
+
]
|
|
21685
|
+
},
|
|
21686
|
+
item.id
|
|
21687
|
+
)) })
|
|
21688
|
+
] })
|
|
21689
|
+
] })
|
|
21690
|
+
]
|
|
21691
|
+
}
|
|
21692
|
+
),
|
|
21693
|
+
/* @__PURE__ */ jsx(
|
|
21694
|
+
ConnectionFormDialog,
|
|
21695
|
+
{
|
|
21696
|
+
open: newConnectionOpen,
|
|
21697
|
+
onClose: () => setNewConnectionOpen(false),
|
|
21698
|
+
providerKey: GITHUB_PROVIDER_KEY,
|
|
21699
|
+
defaultName: "GitHub",
|
|
21700
|
+
onConnectionCreated: (created) => {
|
|
21701
|
+
setNewConnectionOpen(false);
|
|
21702
|
+
setForm((prev) => ({ ...prev, connectionId: created.id }));
|
|
21703
|
+
void refetchConnections();
|
|
21704
|
+
}
|
|
21705
|
+
}
|
|
21706
|
+
),
|
|
21707
|
+
/* @__PURE__ */ jsx(
|
|
21708
|
+
AlertDialog,
|
|
21709
|
+
{
|
|
21710
|
+
open: confirm !== null,
|
|
21711
|
+
onOpenChange: (open) => !open && setConfirm(null),
|
|
21712
|
+
children: /* @__PURE__ */ jsxs(AlertDialogContent, { className: "z-[120]", children: [
|
|
21713
|
+
/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [
|
|
21714
|
+
/* @__PURE__ */ jsx(AlertDialogTitle, { children: confirm?.kind === "unlink" ? tr("fluidgrids.builder.git.unlinkTitle", "Unlink repository?") : `${tr("fluidgrids.builder.git.restoreTitle", "Restore commit")} ${confirm?.kind === "restore" ? shortSha(confirm.sha) : ""}` }),
|
|
21715
|
+
/* @__PURE__ */ jsx(AlertDialogDescription, { children: confirm?.kind === "unlink" ? tr(
|
|
21716
|
+
"fluidgrids.builder.git.unlinkBody",
|
|
21717
|
+
"Publishing and promotions stop committing to Git for every workflow in this workspace. Commits already made stay in the repository."
|
|
21718
|
+
) : tr(
|
|
21719
|
+
"fluidgrids.builder.git.restoreBody",
|
|
21720
|
+
"The workflow file at this commit becomes a new draft version. No existing version changes and nothing is activated."
|
|
21721
|
+
) })
|
|
21722
|
+
] }),
|
|
21723
|
+
/* @__PURE__ */ jsxs(AlertDialogFooter, { children: [
|
|
21724
|
+
/* @__PURE__ */ jsx(AlertDialogCancel, { children: tr("fluidgrids.builder.git.cancel", "Cancel") }),
|
|
21725
|
+
/* @__PURE__ */ jsx(AlertDialogAction, { onClick: () => void handleConfirm(), children: confirm?.kind === "unlink" ? tr("fluidgrids.builder.git.unlink", "Unlink") : tr("fluidgrids.builder.git.restore", "Restore as draft") })
|
|
21726
|
+
] })
|
|
21727
|
+
] })
|
|
21728
|
+
}
|
|
21729
|
+
)
|
|
21730
|
+
]
|
|
21731
|
+
}
|
|
21732
|
+
);
|
|
21733
|
+
}
|
|
20585
21734
|
|
|
20586
21735
|
// src/builder/lib/ai-draft.ts
|
|
20587
21736
|
var AI_DRAFT_POLL_INTERVAL_MS = 2500;
|
|
@@ -20681,7 +21830,7 @@ function canvasHasWork(nodes) {
|
|
|
20681
21830
|
}
|
|
20682
21831
|
|
|
20683
21832
|
// src/builder/hooks/use-ai-workflow-draft.ts
|
|
20684
|
-
function
|
|
21833
|
+
function messageOf3(error) {
|
|
20685
21834
|
return error instanceof Error ? error.message : String(error);
|
|
20686
21835
|
}
|
|
20687
21836
|
function useAiWorkflowDraft() {
|
|
@@ -20738,7 +21887,7 @@ function useAiWorkflowDraft() {
|
|
|
20738
21887
|
setIsGenerating(false);
|
|
20739
21888
|
} catch (pollError) {
|
|
20740
21889
|
if (run !== runRef.current) return;
|
|
20741
|
-
setError(
|
|
21890
|
+
setError(messageOf3(pollError));
|
|
20742
21891
|
setIsGenerating(false);
|
|
20743
21892
|
}
|
|
20744
21893
|
},
|
|
@@ -20775,7 +21924,7 @@ function useAiWorkflowDraft() {
|
|
|
20775
21924
|
);
|
|
20776
21925
|
} catch (startError) {
|
|
20777
21926
|
if (run !== runRef.current) return;
|
|
20778
|
-
setError(
|
|
21927
|
+
setError(messageOf3(startError));
|
|
20779
21928
|
setIsGenerating(false);
|
|
20780
21929
|
}
|
|
20781
21930
|
},
|
|
@@ -21483,6 +22632,7 @@ var FlowBuilder = ({ readOnly = false }) => {
|
|
|
21483
22632
|
!isReadOnly && /* @__PURE__ */ jsx(AiDraftPanel, {}),
|
|
21484
22633
|
/* @__PURE__ */ jsx(VersionHistoryPanel, {}),
|
|
21485
22634
|
/* @__PURE__ */ jsx(EnvironmentsPanel, {}),
|
|
22635
|
+
/* @__PURE__ */ jsx(GitSyncPanel, {}),
|
|
21486
22636
|
/* @__PURE__ */ jsx(SaveFlowButton, {}),
|
|
21487
22637
|
/* @__PURE__ */ jsx(ActivateWorkflowButton, {}),
|
|
21488
22638
|
/* @__PURE__ */ jsx(
|
|
@@ -21505,6 +22655,7 @@ var FlowBuilder = ({ readOnly = false }) => {
|
|
|
21505
22655
|
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1 lg:hidden", children: [
|
|
21506
22656
|
!isReadOnly && /* @__PURE__ */ jsx(AiDraftPanel, { compact: true }),
|
|
21507
22657
|
/* @__PURE__ */ jsx(EnvironmentsPanel, { compact: true }),
|
|
22658
|
+
/* @__PURE__ */ jsx(GitSyncPanel, { compact: true }),
|
|
21508
22659
|
/* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
21509
22660
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
21510
22661
|
Button$1,
|