From f38a2e4eb408b4d66c86313011cbbdee0537fd66 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 21 May 2024 20:45:32 +0800 Subject: [PATCH] chore: Set full configuration by default for list widget Set the full configuration by default for the list widget. This is a temporary solution and will be removed in the future. The full configuration should be set when the list is created. --- widgets/list/list.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/widgets/list/list.go b/widgets/list/list.go index 3eab15ab..29efc8bf 100644 --- a/widgets/list/list.go +++ b/widgets/list/list.go @@ -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 {