From 734bd2c21f6f894be03bc26e677668f53ce84800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Jerman?= Date: Tue, 22 Nov 2022 11:49:03 +0100 Subject: [PATCH] Properly set the multivalue flag on frame columns --- server/pkg/dal/pipeline.go | 16 +++++++++------- server/system/reporting/reporting.go | 12 ++++++++++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/server/pkg/dal/pipeline.go b/server/pkg/dal/pipeline.go index c28b60c93..7ce94263d 100644 --- a/server/pkg/dal/pipeline.go +++ b/server/pkg/dal/pipeline.go @@ -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 } ) diff --git a/server/system/reporting/reporting.go b/server/system/reporting/reporting.go index 2c4723bb8..299991d44 100644 --- a/server/system/reporting/reporting.go +++ b/server/system/reporting/reporting.go @@ -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, }, }) }