Ver código fonte

fix: using parameter_rule.name as the default paramter.label

Yeuoly 6 meses atrás
pai
commit
b2f77fd3b9
1 arquivos alterados com 6 adições e 0 exclusões
  1. 6 0
      pkg/entities/plugin_entities/model_declaration.go

+ 6 - 0
pkg/entities/plugin_entities/model_declaration.go

@@ -256,6 +256,12 @@ var PARAMETER_RULE_TEMPLATE = map[DefaultParameterName]ModelParameterRule{
 }
 
 func (m *ModelParameterRule) TransformTemplate() error {
+	if m.Label == nil || m.Label.EnUS == "" {
+		m.Label = &I18nObject{
+			EnUS: m.Name,
+		}
+	}
+
 	// if use_template is not empty, transform to use default value
 	if m.UseTemplate != nil && *m.UseTemplate != "" {
 		// get the value of use_template