Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
Expand All @@ -83,6 +83,27 @@ export const FlowPanelDefinitionComponent: React.FC = () => {
endpoint = endpoint.replace(`\${{${setting?.flowSettingIdentifier}}}`, setting?.value)
})

const copyEndpoint = (event: React.MouseEvent<HTMLElement>) => {
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] &&
<Panel position={"bottom-right"} data-qa-selector={"flow-builder-definition-panel"}>
<ButtonGroup style={{textWrap: "nowrap"}}>
Expand Down Expand Up @@ -110,9 +131,8 @@ export const FlowPanelDefinitionComponent: React.FC = () => {
) : undefined}
right={
<ButtonGroup color={"primary"}>
<Button onClick={() => {
copyToClipboard(endpoint)
}} paddingSize={"xxs"} variant={"none"} color={"secondary"}>
<Button onClick={copyEndpoint}
paddingSize={"xxs"} variant={"none"} color={"secondary"}>
{hasCopiedText ? <IconCheck size={13}/> :
<IconCopy size={13}/>}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ fragment FlowType on FlowType {
__typename
id
}
runtimeFlowType {
__typename
id
runtimeModule {
__typename
id
}
}
signature
flowTypeSettings (first: $firstFlowTypeSetting, after: $afterFlowTypeSetting) {
__typename
Expand Down
4 changes: 2 additions & 2 deletions src/packages/ce/src/project/views/ProjectsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ export const ProjectsView: React.FC = () => {
</div>
<ButtonGroup>
<Link href={`/namespace/${namespaceId}/projects/create`}>
<Button paddingSize={"xxs"} color={"success"}>Create</Button>
<Button color={"success"}>Create</Button>
</Link>
<Menu>
<MenuTrigger asChild>
<Button paddingSize={"xxs"} color={"secondary"} variant={"filled"}>Sort</Button>
<Button color={"secondary"} variant={"filled"}>Sort</Button>
</MenuTrigger>
<MenuPortal>
<MenuContent>
Expand Down