Use module field label for DAL pipeline outputs
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user