3
0

Properly set the multivalue flag on frame columns

This commit is contained in:
Tomaž Jerman
2022-11-22 11:49:03 +01:00
committed by Jože Fortun
parent 99f6503226
commit 734bd2c21f
2 changed files with 19 additions and 9 deletions

View File

@@ -44,13 +44,15 @@ type (
// MapProperties describe the attribute such as it's type and constraints
MapProperties struct {
Label string
IsPrimary bool
IsSystem bool
IsFilterable bool
IsSortable bool
Nullable bool
Type Type
Label string
IsPrimary bool
IsSystem bool
IsFilterable bool
IsSortable bool
IsMultivalue bool
MultivalueDelimiter string
Nullable bool
Type Type
}
)

View File

@@ -397,8 +397,13 @@ func mappingToFrameCol(m dal.AttributeMapping) FrameColumn {
Label: l,
Kind: "String",
Primary: p.IsPrimary,
System: p.IsSystem,
Primary: p.IsPrimary,
System: p.IsSystem,
Multivalue: p.IsMultivalue,
MultivalueDelimiter: p.MultivalueDelimiter,
}
if out.MultivalueDelimiter == "" {
out.MultivalueDelimiter = "\n"
}
switch t := p.Type.(type) {
@@ -710,6 +715,9 @@ func attrToMapping(aa ...*dal.Attribute) (out []dal.AttributeMapping) {
IsSystem: a.System,
Nullable: a.Type.IsNullable(),
IsPrimary: a.PrimaryKey,
// @todo add multi value delimiter; it's currently not set on the
// attribute so we might need to rethink this a bit
IsMultivalue: a.MultiValue,
},
})
}