diff --git a/compose/service/module.go b/compose/service/module.go index 05ffd6a90..4fb6c7ef9 100644 --- a/compose/service/module.go +++ b/compose/service/module.go @@ -3,14 +3,15 @@ package service import ( "context" "fmt" - "github.com/cortezaproject/corteza-server/compose/dalutils" - "github.com/cortezaproject/corteza-server/pkg/logger" - "go.uber.org/zap" "reflect" "sort" "strconv" "strings" + "github.com/cortezaproject/corteza-server/compose/dalutils" + "github.com/cortezaproject/corteza-server/pkg/logger" + "go.uber.org/zap" + "github.com/cortezaproject/corteza-server/pkg/revisions" "github.com/cortezaproject/corteza-server/pkg/dal" @@ -1534,7 +1535,7 @@ func moduleFieldToAttribute(f *types.ModuleField) (out *dal.Attribute, err error } out.SensitivityLevelID = f.Config.Privacy.SensitivityLevelID - out.Label = f.Name + out.Label = f.Label out.MultiValue = f.Multi return } diff --git a/pkg/dal/pipeline.go b/pkg/dal/pipeline.go index 3c42202b4..2f3848119 100644 --- a/pkg/dal/pipeline.go +++ b/pkg/dal/pipeline.go @@ -38,6 +38,7 @@ type ( // MapProperties describe the attribute such as it's type and constraints MapProperties struct { + Label string IsPrimary bool Nullable bool Type Type diff --git a/system/reporting/reporting.go b/system/reporting/reporting.go index d49de6c23..25472701e 100644 --- a/system/reporting/reporting.go +++ b/system/reporting/reporting.go @@ -383,10 +383,13 @@ func mappingToFrameCol(m dal.AttributeMapping) FrameColumn { moduleResType = "corteza::compose:module" ) + l := m.Properties().Label + if l == "" { + l = m.Identifier() + } out := FrameColumn{ - Name: m.Identifier(), - // @todo use another method/push into meta? - Label: m.Identifier(), + Name: m.Identifier(), + Label: l, Kind: "String", Primary: p.IsPrimary, @@ -651,6 +654,7 @@ func attrToMapping(aa ...*dal.Attribute) (out []dal.AttributeMapping) { Ident: a.Ident, Src: a.Ident, Props: dal.MapProperties{ + Label: a.Label, Type: a.Type, Nullable: a.Type.IsNullable(), IsPrimary: a.PrimaryKey,