@@ -96,12 +96,24 @@ function getAttributesWithDefinitions(note: FNote, attributesToIgnore: string[]
9696 for ( const attr of promotedDefinitionAttributes ) {
9797 const def = attr . getDefinition ( ) ;
9898 const [ type , name ] = attr . name . split ( ":" , 2 ) ;
99- const value = type === "label" ? note . getLabelValue ( name ) : note . getRelationValue ( name ) ;
10099 const friendlyName = def ?. promotedAlias || name ;
101- if ( ! value ) continue ;
102- if ( attributesToIgnore . includes ( name ) ) continue ;
100+ const props : Omit < AttributeWithDefinitions , "value" > = { def, name, type, friendlyName } ;
101+
102+ if ( type === "label" ) {
103+ const labels = note . getLabels ( name ) ;
104+ for ( const label of labels ) {
105+ if ( ! label . value ) continue ;
106+ result . push ( { ...props , value : label . value } ) ;
107+ }
108+ } else if ( type === "relation" ) {
109+ const relations = note . getRelations ( name ) ;
110+ for ( const relation of relations ) {
111+ if ( ! relation . value ) continue ;
112+ result . push ( { ...props , value : relation . value } ) ;
113+ }
114+ }
103115
104- result . push ( { def , name, type , value , friendlyName } ) ;
116+ if ( attributesToIgnore . includes ( name ) ) continue ;
105117 }
106118 return result ;
107119}
0 commit comments