@@ -68,12 +68,12 @@ export const FlowPanelDefinitionComponent: React.FC = () => {
6868 )
6969
7070 const module = React . useMemo (
71- ( ) => moduleService . getById ( flowType ?. runtimeModule ?. id , {
71+ ( ) => moduleService . getById ( flowType ?. runtimeFlowType ?. runtimeModule ?. id , {
7272 namespaceId : namespaceId ,
7373 projectId : projectId ,
7474 runtimeId : project ?. primaryRuntime ?. id
7575 } ) ,
76- [ flowType ?. runtimeModule ?. id , namespaceId , projectId , project ?. primaryRuntime ?. id , moduleStore ]
76+ [ flowType ?. runtimeFlowType ?. runtimeModule ?. id , namespaceId , projectId , project ?. primaryRuntime ?. id , moduleStore ]
7777 )
7878
7979 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 = () => {
8383 endpoint = endpoint . replace ( `\${{${ setting ?. flowSettingIdentifier } }}` , setting ?. value )
8484 } )
8585
86+ const copyEndpoint = ( event : React . MouseEvent < HTMLElement > ) => {
87+ if ( ! navigator ?. clipboard ?. writeText ) {
88+ // Without a secure context there is no Clipboard API and the hook falls back to a
89+ // textarea on document.body, which the modal dialog's focus trap keeps unfocusable,
90+ // so Firefox copies nothing. Run the same fallback inside the dialog instead; the
91+ // copyToClipboard call below still records the copied state.
92+ const dialog = event . currentTarget . closest ( "[role='dialog']" )
93+ if ( dialog ) {
94+ const textArea = document . createElement ( "textarea" )
95+ textArea . value = endpoint
96+ textArea . style . position = "fixed"
97+ textArea . style . opacity = "0"
98+ dialog . appendChild ( textArea )
99+ textArea . select ( )
100+ document . execCommand ( "copy" )
101+ dialog . removeChild ( textArea )
102+ }
103+ }
104+ copyToClipboard ( endpoint )
105+ }
106+
86107 return module ?. definitions ?. nodes ?. [ 0 ] &&
87108 < Panel position = { "bottom-right" } data-qa-selector = { "flow-builder-definition-panel" } >
88109 < ButtonGroup style = { { textWrap : "nowrap" } } >
@@ -110,9 +131,8 @@ export const FlowPanelDefinitionComponent: React.FC = () => {
110131 ) : undefined }
111132 right = {
112133 < ButtonGroup color = { "primary" } >
113- < Button onClick = { ( ) => {
114- copyToClipboard ( endpoint )
115- } } paddingSize = { "xxs" } variant = { "none" } color = { "secondary" } >
134+ < Button onClick = { copyEndpoint }
135+ paddingSize = { "xxs" } variant = { "none" } color = { "secondary" } >
116136 { hasCopiedText ? < IconCheck size = { 13 } /> :
117137 < IconCopy size = { 13 } /> }
118138 </ Button >
0 commit comments