@@ -39,6 +39,7 @@ import {
39
39
FieldLabel ,
40
40
KeyValueList ,
41
41
KeyValuePairs ,
42
+ NodeAttributeValueType ,
42
43
NodeDataProviderResultProcessedData ,
43
44
NodeDataProviderRunData ,
44
45
NodeDataProviderValueInfo ,
@@ -401,24 +402,26 @@ export function getOpNodeAttrsKeyValuePairsForAttrsTable(
401
402
for ( const attrId of Object . keys ( attrs ) ) {
402
403
const key = attrId ;
403
404
const value = attrs [ attrId ] ;
404
- const matchTargets = [ `${ key } :${ value } ` , `${ key } =${ value } ` ] ;
405
- if (
406
- filterRegex . trim ( ) === '' ||
407
- matchTargets . some ( ( matchTarget ) => regex . test ( matchTarget ) )
408
- ) {
409
- // Remove new line chars and spaces.
410
- let processedValue = value ;
411
- if ( key === TENSOR_VALUES_KEY ) {
412
- // For __value attribute, remove all white space chars.
413
- processedValue = value . replace ( / \s / gm, '' ) ;
414
- } else {
415
- // For other attributes, only remove newline chars.
416
- processedValue = value . replace ( / ( \r \n | \n | \r ) / gm, ' ' ) ;
405
+ if ( typeof value === 'string' ) {
406
+ const matchTargets = [ `${ key } :${ value } ` , `${ key } =${ value } ` ] ;
407
+ if (
408
+ filterRegex . trim ( ) === '' ||
409
+ matchTargets . some ( ( matchTarget ) => regex . test ( matchTarget ) )
410
+ ) {
411
+ // Remove new line chars and spaces.
412
+ let processedValue = value ;
413
+ if ( key === TENSOR_VALUES_KEY ) {
414
+ // For __value attribute, remove all white space chars.
415
+ processedValue = value . replace ( / \s / gm, '' ) ;
416
+ } else {
417
+ // For other attributes, only remove newline chars.
418
+ processedValue = value . replace ( / ( \r \n | \n | \r ) / gm, ' ' ) ;
419
+ }
420
+ keyValuePairs . push ( {
421
+ key,
422
+ value : processedValue ,
423
+ } ) ;
417
424
}
418
- keyValuePairs . push ( {
419
- key,
420
- value : processedValue ,
421
- } ) ;
422
425
}
423
426
}
424
427
return keyValuePairs ;
@@ -784,7 +787,19 @@ export function getAttributesFromNode(
784
787
) : KeyValuePairs {
785
788
let attrs : KeyValuePairs = { } ;
786
789
if ( isOpNode ( node ) ) {
787
- attrs = { ...( node . attrs || { } ) } ;
790
+ for ( const [ key , value ] of Object . entries ( node . attrs || { } ) ) {
791
+ if ( typeof value === 'string' ) {
792
+ attrs [ key ] = value ;
793
+ } else {
794
+ switch ( value . type ) {
795
+ case NodeAttributeValueType . NODE_IDS :
796
+ attrs [ key ] = value . nodeIds . join ( ',' ) ;
797
+ break ;
798
+ default :
799
+ break ;
800
+ }
801
+ }
802
+ }
788
803
// Add id to attribute.
789
804
attrs [ 'id' ] = node . id ;
790
805
} else if ( isGroupNode ( node ) ) {
0 commit comments