Browse Source

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

Yeuoly 6 months ago
parent
commit
b2f77fd3b9
1 changed files with 6 additions and 0 deletions
  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