Merge pull request #612 from trheyi/main

chore: Set full configuration by default for list widget
This commit is contained in:
Max 2024-05-21 20:47:22 +08:00 committed by GitHub
commit 4ca1c7f521
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -219,8 +219,17 @@ func (dsl *DSL) Xgen(data map[string]interface{}, excludes map[string]bool, quer
return nil, err
}
// full width default value
if _, has := dsl.Config["full"]; !has {
// ** WARNING **
// set the full configuration by default
// Temporary solution, Will be removed in the future
// should be set when the list is created
config := map[string]interface{}{}
if dsl.Config != nil {
for key, value := range dsl.Config {
config[key] = value
}
}
if _, has := config["full"]; !has {
dsl.Config["full"] = true
}
@ -237,7 +246,7 @@ func (dsl *DSL) Xgen(data map[string]interface{}, excludes map[string]bool, quer
onChange := map[string]interface{}{} // Hooks
setting["fields"] = fields
setting["config"] = dsl.Config
setting["config"] = config
replacements := maps.Map{}
if query != nil {