Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion packages/importer/src/huly/cards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,21 @@ export class CardsProcessor {

const tagProps: Record<string, any> = {}
this.metadataRegistry.getAttributes(tagAbsPath).forEach((attr, label) => {
tagProps[attr.props.name] = cardHeader[label]
const value = cardHeader[label]
const attrType = attr.props.type
const attrBaseType = attrType._class === core.class.ArrOf ? attrType.of : attrType
const values = attrType._class === core.class.ArrOf ? value : [value]
const propValues: any[] = []
for (const val of values) {
if (attrBaseType._class === core.class.RefTo) {
const refPath = path.resolve(path.dirname(cardPath), val)
const ref = this.metadataRegistry.getRef(refPath) as Ref<Card>
propValues.push(ref)
} else {
propValues.push(val)
}
}
tagProps[attr.props.name] = attrType._class === core.class.ArrOf ? propValues : propValues[0]
})

const mixin: UnifiedMixin<Card, Tag> = {
Expand Down