This repository was archived by the owner on Jan 27, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +26
-9
lines changed
plugins/orchestrator/src/components Expand file tree Collapse file tree 2 files changed +26
-9
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @janus-idp/backstage-plugin-orchestrator " : patch
3+ ---
4+
5+ Fixes issue when WorkflowResult panel fails on malformed provided result.
Original file line number Diff line number Diff line change @@ -222,21 +222,33 @@ const WorkflowOutputs = ({
222222
223223 return (
224224 < >
225- { nonLinks . map ( item => (
226- < Grid item md = { 6 } key = { item . key } className = { styles . outputGrid } >
227- < AboutField
228- label = { item . key }
229- value = { ( item . value || VALUE_UNAVAILABLE ) as string }
230- />
231- </ Grid >
232- ) ) }
225+ { nonLinks . map ( item => {
226+ let value = item . value || VALUE_UNAVAILABLE ;
227+ if ( typeof value !== 'string' ) {
228+ // This is a workaround for malformed returned data. It should not happen if the sender does WorkflowResult validation properly.
229+ if ( typeof value === 'object' ) {
230+ value = `Object: ${ JSON . stringify ( value ) } ` ;
231+ } else {
232+ value = 'Unexpected type' ;
233+ }
234+ }
235+
236+ return (
237+ < Grid item md = { 6 } key = { item . key } className = { styles . outputGrid } >
238+ < AboutField label = { item . key } value = { value as string } />
239+ </ Grid >
240+ ) ;
241+ } ) }
233242
234243 { links ?. length > 0 && (
235244 < Grid item md = { 12 } key = "__links" className = { styles . links } >
236245 < AboutField label = "Links" >
237246 < List dense disablePadding >
238247 { links
239- . filter ( item => item . value && item . key )
248+ . filter (
249+ item =>
250+ item . value && item . key && typeof item . value === 'string' ,
251+ )
240252 . map ( item => {
241253 return (
242254 < ListItem disableGutters key = { item . key } >
You can’t perform that action at this time.
0 commit comments