Add format to columns

This commit is contained in:
Darren Shepherd 2019-08-14 11:16:37 -07:00
parent 583309b969
commit f2c0706220
3 changed files with 16 additions and 12 deletions

View File

@ -14,14 +14,16 @@ func (d *DefaultColumns) ModifySchema(schema *types.Schema, schemas *types.Schem
if attributes.Columns(schema) == nil {
attributes.SetColumns(schema, []table.Column{
{
Name: "Name",
Field: "metadata.name",
Type: "string",
Name: "Name",
Field: "metadata.name",
Type: "string",
Format: "name",
},
{
Name: "Created",
Field: "metadata.creationTimestamp",
Type: "date",
Name: "Created",
Field: "metadata.creationTimestamp",
Type: "string",
Format: "date",
},
})
}

View File

@ -47,9 +47,10 @@ func forVersion(group, version, resource string, schemas map[string]*types.Schem
var versionColumns []table.Column
for _, col := range columnDefs {
versionColumns = append(versionColumns, table.Column{
Name: col.Name,
Field: col.JSONPath,
Type: col.Type,
Name: col.Name,
Field: col.JSONPath,
Type: col.Type,
Format: col.Format,
})
}
if len(versionColumns) == 0 {

View File

@ -7,9 +7,10 @@ import (
)
type Column struct {
Name string `json:"name,omitempty"`
Field string `json:"field,omitempty"`
Type string `json:"type,omitempty"`
Name string `json:"name,omitempty"`
Field string `json:"field,omitempty"`
Type string `json:"type,omitempty"`
Format string `json:"format,omitempty"`
}
type Table struct {