File tree 1 file changed +15
-1
lines changed
packages/importer/src/huly
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -602,7 +602,21 @@ export class CardsProcessor {
602
602
603
603
const tagProps : Record < string , any > = { }
604
604
this . metadataRegistry . getAttributes ( tagAbsPath ) . forEach ( ( attr , label ) => {
605
- tagProps [ attr . props . name ] = cardHeader [ label ]
605
+ const value = cardHeader [ label ]
606
+ const attrType = attr . props . type
607
+ const attrBaseType = attrType . _class === core . class . ArrOf ? attrType . of : attrType
608
+ const values = attrType . _class === core . class . ArrOf ? value : [ value ]
609
+ const propValues : any [ ] = [ ]
610
+ for ( const val of values ) {
611
+ if ( attrBaseType . _class === core . class . RefTo ) {
612
+ const refPath = path . resolve ( path . dirname ( cardPath ) , val )
613
+ const ref = this . metadataRegistry . getRef ( refPath ) as Ref < Card >
614
+ propValues . push ( ref )
615
+ } else {
616
+ propValues . push ( val )
617
+ }
618
+ }
619
+ tagProps [ attr . props . name ] = attrType . _class === core . class . ArrOf ? propValues : propValues [ 0 ]
606
620
} )
607
621
608
622
const mixin : UnifiedMixin < Card , Tag > = {
You can’t perform that action at this time.
0 commit comments