Add icon support to Section and TabsItem components

This commit is contained in:
Max 2024-04-09 11:52:19 +08:00
parent edad2e76f3
commit e72463175f
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
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
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)
if err != nil {
return new, err

View file

@ -88,9 +88,12 @@ type FrameDSL struct {
// SectionDSL layout.form.sections[*]
type SectionDSL struct {
Title string `json:"title,omitempty"`
Desc string `json:"desc,omitempty"`
Columns []Column `json:"columns,omitempty"`
Title string `json:"title,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"`
}
// Column table columns