From 641ded53d7d580be816cb5e2950bee899d47356c Mon Sep 17 00:00:00 2001 From: nicosammito Date: Mon, 13 Jul 2026 14:37:12 +0200 Subject: [PATCH 1/2] feat: enhance FlowPanelDefinitionComponent with clipboard copy functionality and update GraphQL fragment --- .../panels/FlowPanelDefinitionComponent.tsx | 30 +++++++++++++++---- .../fragments/FlowType.fragment.graphql | 8 +++++ .../ce/src/project/views/ProjectsView.tsx | 4 +-- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/packages/ce/src/flow/components/panels/FlowPanelDefinitionComponent.tsx b/src/packages/ce/src/flow/components/panels/FlowPanelDefinitionComponent.tsx index 040ad542..c18fe4c5 100644 --- a/src/packages/ce/src/flow/components/panels/FlowPanelDefinitionComponent.tsx +++ b/src/packages/ce/src/flow/components/panels/FlowPanelDefinitionComponent.tsx @@ -68,12 +68,12 @@ export const FlowPanelDefinitionComponent: React.FC = () => { ) const module = React.useMemo( - () => moduleService.getById(flowType?.runtimeModule?.id, { + () => moduleService.getById(flowType?.runtimeFlowType?.runtimeModule?.id, { namespaceId: namespaceId, projectId: projectId, runtimeId: project?.primaryRuntime?.id }), - [flowType?.runtimeModule?.id, namespaceId, projectId, project?.primaryRuntime?.id, moduleStore] + [flowType?.runtimeFlowType?.runtimeModule?.id, namespaceId, projectId, project?.primaryRuntime?.id, moduleStore] ) let endpoint = `http://${module?.definitions?.nodes?.[0]?.host}:${module?.definitions?.nodes?.[0]?.port}${module?.definitions?.nodes?.[0]?.endpoint}` @@ -83,6 +83,27 @@ export const FlowPanelDefinitionComponent: React.FC = () => { endpoint = endpoint.replace(`\${{${setting?.flowSettingIdentifier}}}`, setting?.value) }) + const copyEndpoint = (event: React.MouseEvent) => { + if (!navigator?.clipboard?.writeText) { + // Without a secure context there is no Clipboard API and the hook falls back to a + // textarea on document.body, which the modal dialog's focus trap keeps unfocusable, + // so Firefox copies nothing. Run the same fallback inside the dialog instead; the + // copyToClipboard call below still records the copied state. + const dialog = event.currentTarget.closest("[role='dialog']") + if (dialog) { + const textArea = document.createElement("textarea") + textArea.value = endpoint + textArea.style.position = "fixed" + textArea.style.opacity = "0" + dialog.appendChild(textArea) + textArea.select() + document.execCommand("copy") + dialog.removeChild(textArea) + } + } + copyToClipboard(endpoint) + } + return module?.definitions?.nodes?.[0] && @@ -110,9 +131,8 @@ export const FlowPanelDefinitionComponent: React.FC = () => { ) : undefined} right={ - diff --git a/src/packages/ce/src/flowtype/services/fragments/FlowType.fragment.graphql b/src/packages/ce/src/flowtype/services/fragments/FlowType.fragment.graphql index 288eb7f4..c0479cb9 100644 --- a/src/packages/ce/src/flowtype/services/fragments/FlowType.fragment.graphql +++ b/src/packages/ce/src/flowtype/services/fragments/FlowType.fragment.graphql @@ -31,6 +31,14 @@ fragment FlowType on FlowType { __typename id } + runtimeFlowType { + __typename + id + runtimeModule { + __typename + id + } + } signature flowTypeSettings (first: $firstFlowTypeSetting, after: $afterFlowTypeSetting) { __typename diff --git a/src/packages/ce/src/project/views/ProjectsView.tsx b/src/packages/ce/src/project/views/ProjectsView.tsx index 71f73b67..be1aca32 100644 --- a/src/packages/ce/src/project/views/ProjectsView.tsx +++ b/src/packages/ce/src/project/views/ProjectsView.tsx @@ -55,11 +55,11 @@ export const ProjectsView: React.FC = () => { - + - + From 2e10d1b0d8ce17a67703f13cfd9a210ebc8a4ed3 Mon Sep 17 00:00:00 2001 From: nicosammito Date: Mon, 13 Jul 2026 14:46:11 +0200 Subject: [PATCH 2/2] feat: update triangulum package version to 0.26.2 for improvements --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5483a565..6c3f5d31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@apollo/client": "^4.0.9", "@code0-tech/pictor": "^0.11.1", - "@code0-tech/triangulum": "^0.26.1", + "@code0-tech/triangulum": "^0.26.2", "@codemirror/lang-javascript": "^6.2.5", "@codemirror/lint": "^6.9.5", "@icons-pack/react-simple-icons": "^13.13.0", @@ -1946,9 +1946,9 @@ "peer": true }, "node_modules/@code0-tech/triangulum": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/@code0-tech/triangulum/-/triangulum-0.26.1.tgz", - "integrity": "sha512-HPI/oJb0Y6PgwadJ4m131bWibjSEHQZpbcJM7jNF5wGWtZmTxOicaqVqDkMRjfqEyJ3tFllU9Cemfp547nqaXA==", + "version": "0.26.2", + "resolved": "https://registry.npmjs.org/@code0-tech/triangulum/-/triangulum-0.26.2.tgz", + "integrity": "sha512-CFL2WFzJQuxn2KltPyZdjkmQFWgv6ZweqgZK/OmJ/B+lUhV2+ITxPcoqGzvR5b0Elnvt6nRQjcy6etvlYIHDWA==", "peerDependencies": { "@code0-tech/sagittarius-graphql-types": "0.0.0-experimental-2668386432-315fff7e9283580109793944cb24db116d9cc264", "@typescript/vfs": "^1.6.4", diff --git a/package.json b/package.json index aafbc8fc..950211fc 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "dependencies": { "@apollo/client": "^4.0.9", "@code0-tech/pictor": "^0.11.1", - "@code0-tech/triangulum": "^0.26.1", + "@code0-tech/triangulum": "^0.26.2", "@codemirror/lang-javascript": "^6.2.5", "@codemirror/lint": "^6.9.5", "@icons-pack/react-simple-icons": "^13.13.0",