Merge pull request #600 from trheyi/main

Add icon support to Section and TabsItem components
This commit is contained in:
Max 2024-04-09 11:53:14 +08:00 committed by GitHub
commit 07ded02606
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 5 deletions

View file

@ -38,7 +38,7 @@ func TestLoadID(t *testing.T) {
} }
} }
func prepare(t *testing.T, language ...string) { func prepare(t *testing.T) {
// load flows // load flows
err := flow.Load(config.Conf) err := flow.Load(config.Conf)

View file

@ -264,7 +264,7 @@ func (layout *LayoutDSL) Xgen(data map[string]interface{}, excludes map[string]b
// Filter exclude filter // Filter exclude filter
func (section SectionDSL) Filter(excludes map[string]bool, mapping *mapping.Mapping) (SectionDSL, error) { func (section SectionDSL) Filter(excludes map[string]bool, mapping *mapping.Mapping) (SectionDSL, error) {
new := SectionDSL{Columns: []Column{}, Title: section.Title, Desc: section.Desc} new := SectionDSL{Columns: []Column{}, Title: section.Title, Desc: section.Desc, Icon: section.Icon, Weight: section.Weight, Color: section.Color}
columns, err := section.filterColumns(section.Columns, excludes, mapping) columns, err := section.filterColumns(section.Columns, excludes, mapping)
if err != nil { if err != nil {
return new, err return new, err

View file

@ -90,6 +90,9 @@ type FrameDSL struct {
type SectionDSL struct { type SectionDSL struct {
Title string `json:"title,omitempty"` Title string `json:"title,omitempty"`
Desc string `json:"desc,omitempty"` Desc string `json:"desc,omitempty"`
Icon interface{} `json:"icon,omitempty"`
Color string `json:"color,omitempty"`
Weight interface{} `json:"weight,omitempty"`
Columns []Column `json:"columns,omitempty"` Columns []Column `json:"columns,omitempty"`
} }