@@ -493,7 +493,7 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
493493 ( metric : { name : string } ) => `${ normalizedBlockName } .${ metric . name . toLowerCase ( ) } `
494494 )
495495 } else {
496- const outputPaths = generateOutputPaths ( blockConfig . outputs )
496+ const outputPaths = getBlockOutputPaths ( sourceBlock . type , mergedSubBlocks )
497497 blockTags = outputPaths . map ( ( path ) => `${ normalizedBlockName } .${ path } ` )
498498 }
499499 } else if ( sourceBlock . type === 'variables' ) {
@@ -515,7 +515,11 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
515515 if ( schemaFields . length > 0 ) {
516516 blockTags = schemaFields . map ( ( field ) => `${ normalizedBlockName } .${ field . name } ` )
517517 } else {
518- const outputPaths = generateOutputPaths ( blockConfig . outputs || { } )
518+ const outputPaths = getBlockOutputPaths (
519+ sourceBlock . type ,
520+ mergedSubBlocks ,
521+ sourceBlock . triggerMode
522+ )
519523 blockTags = outputPaths . map ( ( path ) => `${ normalizedBlockName } .${ path } ` )
520524 }
521525 } else if ( ! blockConfig . outputs || Object . keys ( blockConfig . outputs ) . length === 0 ) {
@@ -573,21 +577,19 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
573577 if ( dynamicOutputs . length > 0 ) {
574578 blockTags = dynamicOutputs . map ( ( path ) => `${ normalizedBlockName } .${ path } ` )
575579 } else {
576- const outputPaths = generateOutputPaths ( blockConfig . outputs || { } )
580+ const outputPaths = getBlockOutputPaths ( sourceBlock . type , mergedSubBlocks , true )
577581 blockTags = outputPaths . map ( ( path ) => `${ normalizedBlockName } .${ path } ` )
578582 }
579583 } else if ( sourceBlock . type === 'approval' ) {
580- // For approval block, use dynamic outputs based on inputFormat
581584 const dynamicOutputs = getBlockOutputPaths ( sourceBlock . type , mergedSubBlocks )
582585
583- // If it's a self-reference, only show url (available immediately)
584586 const isSelfReference = activeSourceBlockId === blockId
585587
586588 if ( dynamicOutputs . length > 0 ) {
587589 const allTags = dynamicOutputs . map ( ( path ) => `${ normalizedBlockName } .${ path } ` )
588590 blockTags = isSelfReference ? allTags . filter ( ( tag ) => tag . endsWith ( '.url' ) ) : allTags
589591 } else {
590- const outputPaths = generateOutputPaths ( blockConfig . outputs || { } )
592+ const outputPaths = getBlockOutputPaths ( sourceBlock . type , mergedSubBlocks )
591593 const allTags = outputPaths . map ( ( path ) => `${ normalizedBlockName } .${ path } ` )
592594 blockTags = isSelfReference ? allTags . filter ( ( tag ) => tag . endsWith ( '.url' ) ) : allTags
593595 }
@@ -601,7 +603,11 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
601603 if ( toolOutputPaths . length > 0 ) {
602604 blockTags = toolOutputPaths . map ( ( path ) => `${ normalizedBlockName } .${ path } ` )
603605 } else {
604- const outputPaths = generateOutputPaths ( blockConfig . outputs || { } )
606+ const outputPaths = getBlockOutputPaths (
607+ sourceBlock . type ,
608+ mergedSubBlocks ,
609+ sourceBlock . triggerMode
610+ )
605611 blockTags = outputPaths . map ( ( path ) => `${ normalizedBlockName } .${ path } ` )
606612 }
607613 }
@@ -845,7 +851,7 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
845851 ( metric : { name : string } ) => `${ normalizedBlockName } .${ metric . name . toLowerCase ( ) } `
846852 )
847853 } else {
848- const outputPaths = generateOutputPaths ( blockConfig . outputs )
854+ const outputPaths = getBlockOutputPaths ( accessibleBlock . type , mergedSubBlocks )
849855 blockTags = outputPaths . map ( ( path ) => `${ normalizedBlockName } .${ path } ` )
850856 }
851857 } else if ( accessibleBlock . type === 'variables' ) {
@@ -867,7 +873,11 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
867873 if ( schemaFields . length > 0 ) {
868874 blockTags = schemaFields . map ( ( field ) => `${ normalizedBlockName } .${ field . name } ` )
869875 } else {
870- const outputPaths = generateOutputPaths ( blockConfig . outputs || { } )
876+ const outputPaths = getBlockOutputPaths (
877+ accessibleBlock . type ,
878+ mergedSubBlocks ,
879+ accessibleBlock . triggerMode
880+ )
871881 blockTags = outputPaths . map ( ( path ) => `${ normalizedBlockName } .${ path } ` )
872882 }
873883 } else if ( ! blockConfig . outputs || Object . keys ( blockConfig . outputs ) . length === 0 ) {
@@ -879,21 +889,19 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
879889 if ( dynamicOutputs . length > 0 ) {
880890 blockTags = dynamicOutputs . map ( ( path ) => `${ normalizedBlockName } .${ path } ` )
881891 } else {
882- const outputPaths = generateOutputPaths ( blockConfig . outputs || { } )
892+ const outputPaths = getBlockOutputPaths ( accessibleBlock . type , mergedSubBlocks , true )
883893 blockTags = outputPaths . map ( ( path ) => `${ normalizedBlockName } .${ path } ` )
884894 }
885895 } else if ( accessibleBlock . type === 'approval' ) {
886- // For approval block, use dynamic outputs based on inputFormat
887896 const dynamicOutputs = getBlockOutputPaths ( accessibleBlock . type , mergedSubBlocks )
888897
889- // If it's a self-reference, only show url (available immediately)
890898 const isSelfReference = accessibleBlockId === blockId
891899
892900 if ( dynamicOutputs . length > 0 ) {
893901 const allTags = dynamicOutputs . map ( ( path ) => `${ normalizedBlockName } .${ path } ` )
894902 blockTags = isSelfReference ? allTags . filter ( ( tag ) => tag . endsWith ( '.url' ) ) : allTags
895903 } else {
896- const outputPaths = generateOutputPaths ( blockConfig . outputs || { } )
904+ const outputPaths = getBlockOutputPaths ( accessibleBlock . type , mergedSubBlocks )
897905 const allTags = outputPaths . map ( ( path ) => `${ normalizedBlockName } .${ path } ` )
898906 blockTags = isSelfReference ? allTags . filter ( ( tag ) => tag . endsWith ( '.url' ) ) : allTags
899907 }
@@ -907,7 +915,11 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
907915 if ( toolOutputPaths . length > 0 ) {
908916 blockTags = toolOutputPaths . map ( ( path ) => `${ normalizedBlockName } .${ path } ` )
909917 } else {
910- const outputPaths = generateOutputPaths ( blockConfig . outputs || { } )
918+ const outputPaths = getBlockOutputPaths (
919+ accessibleBlock . type ,
920+ mergedSubBlocks ,
921+ accessibleBlock . triggerMode
922+ )
911923 blockTags = outputPaths . map ( ( path ) => `${ normalizedBlockName } .${ path } ` )
912924 }
913925 }
0 commit comments