3
0

Use module field label for DAL pipeline outputs

This commit is contained in:
Tomaž Jerman
2022-09-20 13:10:06 +02:00
parent fab9371805
commit c5c7ca011b
3 changed files with 13 additions and 7 deletions

View File

@@ -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
}

View File

@@ -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

View File

@@ -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,